Read: class 2
Using semantic elements in HTML is important because it helps structure the content in a meaningful way, making it more accessible and understandable for both humans and machines, like search engines and screen readers. Semantic elements provide information about the type and purpose of the content they enclose, making it easier to style and navigate the page and improving SEO.
There are six levels of headings in HTML, h1 tag is the highest level heading, and h6 tag is the lowest.
The <sup> & <sub> sub elements are used for superscript and subscript text, respectively. Some common uses include mathematical notations, footnotes, chemical formulas, and trademark symbols.
When using the ` `abbr element, the ‘title’ attribute to provide the full expansion of the term, which is often displayed as a tooltip when a user hovers over the abbreviated text.
External CSS: Link an external CSS file to your HTML document using the ` ` element.
Internal CSS: Use the style tag within the HTML document’s <head> section.
Inline CSS: Apply styles directly to individual HTML elements using the style attribute.
CSS frameworks: Utilize pre-built CSS frameworks like Bootstrap to style your HTML elements.
We should avoid inline styles because they mix HTML structure with styling, making it harder to maintain and scale your website. Separating HTML and CSS into external or internal stylesheets provides better organization and maintainability.
tip: Separating HTML and CSS into external or internal stylesheets provides better organization and maintainability.
CSS code block:
Four types of JavaScript operators are:
Arithmetic operators (e.g., +, -, *, /)
Comparison operators (e.g., ==, ===, !=, !==, >, <, >=, <=)
| Logical operators (e.g., &&, | , !) |
A real-world problem that you could solve with a function is calculating the total cost of items in a shopping cart, applying discounts, and calculating taxes.
An if statement checks a condition, and if it evaluates to true, then the code block will execute.
The use of an else if allows you to specify an additional condition to check when the initial condition in an if statement is false. It provides an alternative code block to execute if the else if condition is true.
Three different types of comparison operators in JavaScript are:
| The logical operator && (logical AND) returns true if both of its operands are true. The logical operator | (logical OR) returns true if at least one of its operands is true. They are used to combine conditions and make decisions in your code. |
10/23/2023