View on GitHub

reading-notes

Daily Reading 2

Why is it important to use semantic elements in our HTML?

Correct semeantics allows the user’s browser to understand what element is being displayed, and assists for ensuring that it’s formatted and displayed correctly, and interacts with assistive tools the user may have, like screen readers.

How many levels of headings are there in HTML?

There are 6. H1,H2,H3,H4,H5,H6.

What are some uses for the <sup> and <sub> elements?

<sup> refers to Supertext, and <sub> refers to Subtext. They make text appear smaller and aligned higher up for supertext, and lower for subtext. supertext could be used for things like numeric exponents. subscript can be used to give the impression of a whisper, or a side note.

When using the <abbr> element, what attribute must be added to provide the full expansion of the term?

A ‘title’ attribute.

What are ways we can apply CSS to our HTML?

Why should we avoid using inline styles?

Cleaner code, having all CSS in an external CSS file allows future folks to be able to know in a moment where the style rule is.

Review the block of code below and answer the following questions:

h2 {
    color: black;
    padding: 5px;
   }

What data type is a sequence of text enclosed in single quote marks?

A String.

List 4 types of JavaScript operators.

Arithmetic (2 + 3 = 5) Comparison (Points != 0) Logical (A && B) Assignment (A = 5)

Describe a real world Problem you could solve with a Function.

Creating a template calculator where you provide the two dimensions of a piece of wood, and it responds with the total area, and approximate cost of materials.

An if statement checks a __ and if it evaluates to ___, then the code block will execute.

Boolean, True

What is the use of an else if?

Asking consecutive If statements for conditions that have more than 2 outcomes. Else If allows for making another branched If within the first.

List 3 different types of comparison operators.

== Is Equal to.

> Is greater than.

!= Is NOT equal to.

What is the difference between the logical operator && and ||?

for this example , we’re going to use the boolean variables A, and B.

&& is AND.
A && B will ONLY return a "True" boolean if *both* A and B are set to True. Either, or both being False will return a False value.

|| is OR.  If only A is true, if only B is true, or if BOTH are true, then a True value will be returned. *only* if both are false will a False value be returned.

Back To Main Page.