Some of the benefits from writing semantic markup are as follows:
- Search engines will consider its contents as important keywords to influence the page’s search rankings (see SEO)
- Screen readers can use it as a signpost to help visually impaired users navigate a page
- Finding blocks of meaningful code is significantly easier than searching through endless divs with or without semantic or namespaced classes
- Suggests to the developer the type of data that will be populated
- Semantic naming mirrors proper custom element/component naming
There are 6 levels of headings, with h1 being the highest section level and h6 is the lowest.
<sup>
and <sub>
elements?<sup>
, or superscripts, are usually rendered with a raised baseline using smaller text.
Example: Displaying exponents (x 4), or representing ordinal numbers (4th)
<sub>
, or subscripts, are typically rendered with a lowered baseline using smaller text.
Example: marking up footnote numbers or denoting the number of atoms of a given element within a chemical formula (H 20).
the
title
attribute, along with a full description and nothing else can provide an expansion for the abbreviation or acronym when a full expansion is not present.
CSS can be applied to an HTML document through 3 methods:
- an external stylesheet (
<link rel="stylesheet" href="styles.css" />
)- with an internal stylesheet (
<style> h1 {color:blue;}</style>
)- or with inline syles. (
<p style="color:blue;">#1 CSS example</p>
)
Because one change might require multuple edits within a single web page CSS will mix presentational code with HTML and content, making everything more difficult to read and understand. Separating code and content makes maintenance easier for all who work on the website.
The selector,
h2
, will target all of the<h2>
elements on the page.
color: black
andpadding: 5px;
are the CSS declarations.
color
andpadding
are the properties.
A string is a sequence of text eclosed in single (or double) quote marks.
*An operator is a mathematical symbol that produces a result based on two values (or variables).
- Addition (
+
) - Add two numbers together or combine two strings.Example: 3 + 7; 'Hey' + 'world!;
- Subtraction, Multiplication, Division (
-
,*
,/
) - These do what you’d expect them to do in basic math.
- Assignment (
=
)Example: let myVariable = 'Jane';
- Strict equality (
===
) or loose equality (==
)
- Not, Does-not-equal (
!, !==
)
A function could be used to protect a customer’s account with a secure password, or compute the total of an online store’s cart whenever the customer selects the “checkout” button!
__
and if it evaluates to ___
, then the code block will execute.An if statement checks a
condition
and if it evaluates tobe true
, then the code block will execute.
An else if statement in Javascript is used when you have more than two possible outcomes, with each outcome requiring different conditions to be checked.
===
and!==
— test if one value is identical to, or not identical to, another.
<
and>
— test if one value is less than or greater than another.
<=
and>=
— test if one value is less than or equal to, or greater than or equal to, another.
&&
— AND; allows you to chain together two or more expressions so that all of them have to individually evaluate to true for the whole expression to return true.
||
— OR; allows you to chain together two or more expressions so that one or more of them have to individually evaluate to true for the whole expression to return true.
1.) Javascript is a very complex code, and i’m wondering how deep the pool goes. Beyond ele,if and for loops, what other options are there and how complicated does it get?