reading-notes

Think you might be in the wrong place? Go home!

Introduction to HTML - Part II

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

It’s vital for accessibility, SEO, and code consistency.

How many levels of headings are there in HTML?

HTML has six heading levels (h1 to h6).

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

Used for superscript and subscript, e.g., math notations.

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

When using the <abbr> element, you should add the ‘title’ attribute to provide the full expansion of the term. For instance: <abbr title=”World Wide Web”>WWW</abbr>.

What are ways we can apply CSS to our HTML?

Applied via inline, internal, or external styles.

Why should we avoid using inline styles?

They hinder maintainability and code reusability.

Review the block of code below and answer the following questions

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

What is representing the selector?

The selector is “h2” in the CSS code. It specifies that the styles inside the curly braces apply to all <h2> elements in the HTML document.

Which components are the CSS declarations?

There are two declarations:

Which components are considered properties?

The properties are “color” and “font-size.” These properties determine the text color and font size for all <h2> elements targeted by this CSS rule.

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

A sequence of text enclosed in single quotes represents a “String” data type in JavaScript.

List 4 types of JavaScript operators.

Four types of JavaScript operators include arithmetic, comparison, logical, and assignment operators.

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

A real-world problem that can be solved with a function is calculating the total cost of an online shopping cart, including tax and shipping fees. The function takes a subtotal as input and returns the total cost, making it a reusable solution for different shopping carts.

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

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

What is the use of an else if?

The purpose of an “else if” statement is to provide an alternative condition to check when the initial “if” condition is false. It allows for multiple condition checks in a series.

List 3 different types of comparison operators.

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

Information gathered using ChatGPT