reading-notes

Reading notes about code for my future reference.

View the Project on GitHub

Reading Assignment 2

HTML Continued…

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

It is important to use semantics in HTML in order to convey information in a digestable manner to the reader. Semantics can organize and list the textual information and make it easier to read. It can also interact with the web browser and search engines!

  1. How many levels of headings in HTML?

There are exactly 6 levels of heading starting with h1-h6. H1 being the biggest and H6 being the smallest!

  1. What are some uses for the sup and sub element tags?

According to MDN (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/sup) and (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/sub)

3 Uses for Sup and Sub are as follows.

< Sup >

< Sub >

The < abbr > element!

4 . When using the element, what attribute must be added to provide the full expansion of the term?

The abbreviation element must be used with a title attribute in order to give it a fully readable context for the users.

CSS Continued…

  1. What are ways we can apply CSS to our HTML?
    • Externally you can apply a CSS style sheet with a .css extension and linking that file to the style part of the html document!
  1. Why should we avoid using inline styles?

You should avoid this kind of styling because its inefficent, causes issues down the road. It really just complicates the entire process.

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

h2 {

 color: black;
 padding: 5px;    } 1. **What is representing the selector?**

h2 is representing the selector

  1. Which components are the CSS declarations?

Color and Padding are the declarations.

  1. Which components are considered properties?

black and padding are both considered the properties of the declarations.

JS Continued…

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

The data type is refering to a string regardless of whether a number or text is in there.

  1. List 4 types of JavaScript operators.

The 4 kinds of data type operators are as follows.

  1. Addition = + (combine numbers or strings)

  2. Subtraction = - (Works as in a math)

  3. Assignment = = (Assigns what a variable means or equates to)

  4. Strict Equality = == (Refers to booleans whether a statement equals true or false )

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

You could use functions to gather data over a period of time. You wouldn’t have to change the code/ script and have the program just log itself, if you put the appropriate code and then check back on it days later.

  1. An if statement checks an else and if it evaluates to true, then the code block will execute.

  2. What’s the use of an else if statement?

The usage of an else if statement is to give the function an addtional option for closure if none of the other preset answers were given.

  1. List 3 different types of comparison operators.

source (https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/conditionals)

  1. **What is the difference between the logical operator && and   ?**

source (https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/conditionals)

Back to Home