This topic matters because these are foundational elements to web development.
semantics give the humans reading our code (and indeed scrapers) an intuitive understanding about what data is being displayed, and how/where to find it.
There are six, and no more than 3 different headings are recommended per page. One should use them in the correct order too (i.e. h2 always comes before h3)
<sup>
and <sub>
elements?
<sup>
is a superscript E = mc2<sub
is a subscript H2O
<abbr>
element, what attribute must be added to provide the full expansion of the term?
the
<title>
attribute should be used to convey the full meaning of the term that you’re abbreviating.
- external stylesheet: referencing a .css file using
<style>
in the<head>
section.- internal stylesheet: css code written in the HTML file, using the
<style>
element, also within the<head>
section.- inline: you add the attribute directly in the element itself, as follows:
<p style="color:red;">This is my first CSS example</p>
- it’s inefficient for maintenance, and difficult to read/understand.
- it might only be used when using a CMS or other system that doesn’t let you add a CSS file, or alter the internal ss.
h2 {
color: black;
padding: 5px;
}
- What is representing the selector?
- The selector is represented by h2
- Which components are the CSS declarations?
- when a property is paired with a value, that makes it a CSS declaration. The CSS declarations here are
color: black
andpadding: 5px
.
- Which components are considered properties?
color
andpadding
- this is a string
- Arithmetic operators (+, -, *, /, %)
- Assignment operators (=, +=, -=)
- Comparison operators (==, ===, !=, !==, <, >, <=, >=)
Logical operators (&&, , !)
- one could calculate the cost of all the items within a shopping cart (e.g.
calculateTotalCost()
)
conditional statement, True
if the previous conditional statements are not true, then more conditional statements are tested.
I’m listing 4 so that I remember this for later:
- Equality Operator (==): Checks if two values are equal, irrespective of their data types. For example,
4 == "4"
would be true.- Strict Equality Operator (===): Checks if two values are equal in both value and data type. For example,
4 === "4"
would be false.- Inequality Operator (!=): Checks if two values are not equal; only the values not the data types. So,
4 != "4"
would be false.- Strict Inequality Operator (!==): Checks if two values are not equal; the values AND the data types. So,
4 !== "4"
is true.
- && (AND): returns TRUE if all conditionals are also true. One False and the whole thing returns FALSE.
(OR)*: only one TRUE needs to be returned for the OR to return a TRUE. If there are no TRUE’s, then a FALSE is returned.
general > class > id
calc()
and rotate()
git commit
always include a message that is useful. How is something useful? Well, don’t say WHAT you changed something, say WHY you changed it.