It is important to use semantic elements in our HTML because it gives our elements a logical name that can be understood by other developers. Giving an element a name of <header>
instead of <div>
lets other devs know that this is a header section where a nav, a brand and maybe a title would go. A <div>
is not semantic and does not convey the same information as a <header>
would in the structure of the HTML
There are 6 levels of headings in HTML. <h1>, <h2>, <h3>, <h4>, <h5>, <h6>
<sup>
and <sub>
elements?The <sub>
stands for subscript and the <sup>
stands for superscript. Some uses for the <sub>
and <sup>
elements are in marking up dates, chemical formulas and mathematical equations.
Example of what it would look like:
<p>Today is the 10<sup>th</sup> of January 2023.
<abbr>
element, what attribute must be added to provide the full expansion of the term?When you are using the <abbr>
element, the title
attribute must be added with the full word that is being abbreviated. Such as:
<p> My address is on 1234 madeup <abbr title="Court">Ct.</abbr>.
We can apply CSS to our HTML using inline styling, inline stylesheets or external stylesheets.
We should avoid using inline styles whenever possible because it is the least efficient way to implement CSS and for the sake of maintaining a website. When we have to go back and edit the CSS, with inline styling, we would have to go into each element and edit them. Best practice is to separate the HTML, CSS, and JS files when possible.
h2 {
color: black;
padding: 5px;
}
the h2
selector.
the color
and padding
the black
and the 5px
A string
Additon +
, Subtraction -
, Multiplication *
, Modulo %
You can solve redundant and repetetive code by storing it in a function and calling it whenever it needs to execute.
condition, true
to provide more choices if the first if statement is
===
strict equals, <
less than, >
greater than
What is the difference between the logical operator && and | ? |
&&
is true if both expressions are true, ||
is true if one of the expressions are true
References