Read 02 ~ HTML Text, CSS Introduction, and Basic JavaScript Instructions
By Abdallah obaid
NAME | URL |
---|---|
Home | Home. |
Read 01 | Introductory HTML and JavaScript. |
Read 02 | HTML Text, CSS Introduction, and Basic JavaScript Instructions. |
Read 03 | HTML Lists, CSS Boxes, JS Control Flow. |
Read 04 | HTML Links, CSS Layout, JS Functions. |
Read 05 | HTML Images; CSS Color & Text. |
Read 06 | JS Object Literals; The DOM. |
Read 07 | HTML Tables; JS Constructor Functions. |
Read 08 | More CSS Layout. |
Read 09 | Forms and Events. |
Read 10 | JS Debugging. |
Read 11 | Assorted Topics. |
Read 12 | Docs for the HTML canvas Element & Chart.js. |
Read 13 | Local Storage. |
Read 14a | CSS Transforms, Transitions, and Animations. |
Read 14b | What Google Learned About Teams. |
Html:-
- When the browser comes across two or more spaces next to each other, it only displays one space.Similarly if it comes across a line break, it treats that as a single space too. This is known as white space collapsing.
- To add a line break inside the middle of a paragraph you can use the line break tag
<br />
. - To create a break between themes — such as a change of topic in a book or a new scene in a play — you can add a horizontal rule between sections using the
<hr />
tag. - By enclosing words in the tags
<b>
and</b>
we can make characters appear bold. - By enclosing words in the tags
<i>
and</i>
we can make characters appear italic. - The
<sup>
element is used to contain characters that should be superscript such as the suffixes of dates or mathematical concepts like raising a number to a power. - The
<sub>
element is used to contain characters that should be subscript. It is commonly used with foot notes or chemical formulas such as. - Structural markup: the elements that you can use to describe both headings and paragraphs.
- Semantic markup: which provides extra information; such as where emphasis is placed in a sentence, that something you have written is a quotation (and who said it), the meaning of acronyms, and so on.
- The use of the
<strong>
element indicates that its content has strong importance. For example, the words contained in this element might be said with strong emphasis. By default, browsers will showthe contents of a<strong>
element in bold. - The
<em>
element indicates emphasis that subtly changes the meaning of a sentence. By default browsers will show the contents of an<em>
element in italic. - The
<blockquote>
element is used for longer quotes that take up an entire paragraph. Note how the<p>
element is still used inside the<blockquote>
element. - The
<q>
element is used for shorter quotes that sit within a paragraph. Browsers are supposed to put quotes around the<q>
element, however Internet Explorer does not — therefore many people avoid using the<q>
element. - The
<abbr>
element can be used. A title attribute on the opening tag is used to specify the full term. - The
<cite>
element can be used to indicate where the citation is from. - The
<dfn>
element is used to indicate the defining instance of a new term. - The
<address>
element has quite a specific use: to contain contact details for the author of the page. - The
<ins>
element can be used to show content that has been inserted into a document, while the<del>
element can show text that has been deleted from it. - The
<s>
element indicates something that is no longer accurate or relevant (but that should not be deleted).Css:-
- CSS Associates Style rules with HTML elements.
- CSS Properties Affect How Elements Are Displayed.
- The
<link>
element can be used in an HTML document to tell the browser where to find the CSS file used to style the page. It is an empty element (meaning it does not need a closing tag). href
: This specifies the path to the CSS file (which is often placed in a folder called css or styles).type
: This attribute specifies the type of document being linked to. The value should be text/css.rel
: This specifies the relationship between the HTML page and the file it is linked to. The value should be stylesheet when linking to a CSS file.- If there are two or more rules that apply to the same element, it is important to understand which will take precedence.
Js:-
- A script is a series of instructions that a computer can follow one-by-one. Each individual instruction or step is known as a statement. Statements should end with a semicolon. • Each of the lines of code in green is a statement. • The pink curly braces indicate the start and end of a code block. (Each code block could contain many more statements.) • The code in purple determines which code should run (as you will see on p149)
- JavaScript is case sensitive so hourNow means something different to HourNow or HOURNOW.
- MULTI-LINE COMMENTS: To write a comment that stretches over more than one line, you use a multi-line comment, starting with the /* characters and ending with the */ characters. Anything between these characters is not processed· by the JavaScript interpreter.
- SINGLE-LINE COMMENTS: In a single-line comment, anything that follows the two forward slash characters I/ on that line will not be processed by the JavaScript interpreter. Singleline comments are often used for short descriptions of what the code is doing.
- A script will have to temporarily store the bits of information it needs to do its job. It can store this data in variables.
- DATA TYPES: •numbers •strings •Booleans
- An array is a special type of variable. It doesn’t just store one value; it stores a list of values.
- We use while when we want the client to put the true vale in the prompt>
- Comparison operators (===, ! ==, ==, ! =, <, >, <=, =>) are used to compare two operands.
- Logical operators allow you to combine more than one set of comparison operators.
- if … else statements allow you to run one set of code if a condition is true, and another if it is false.
- switch statements allow you to compare a value against possible outcomes (and also provides a default option if none match).
- Data types can be coerced from one type to another.
- All values evaluate to either truthy or falsy.
- There are three types of loop: for, while, and do …. while. Each repeats a set of statements.