Reading assignment 2
Why is it important to use semantic elements in our HTML?
- Semantic elements give the content the correct purpose, function, or appearance
How many levels of headings are there in HTML?
What are some uses for the <sup> and <sub> elements?
-To correctly render dates, chemical formulas, mathematical equations
- referece: https://developer.mozilla.org/en-US/docs/Learn/HTML/Introduction_to_HTML/Advanced_text_formatting
When using the element, what attribute must be added to provide the full expansion of the term?
- Title attribute must be added to provide the full expansion of the word abbreviation tag is wrapping
What are ways we can apply CSS to our HTML?
- Link to an external CSS stylesheet from HTML document <link rel="styelesheet” href=’location of css file’/> or the HTML document can contain an internal stylesheet inside <style> element inside the <head> element. There is also inline stylesheet that affect a individual HTML element contained within a style attribute
Why should we avoid using inline styles?
-It is a terribly inefficient and error prone for maintenance
Review the block of code below and answer the following questions:
h2 {
color: black;
padding: 5px;
}
What is representing the selector?
- h2
Which components are the CSS declarations?
- Properties and values between two curly brackets
Which components are considered properties?
- color:black; padding: 5px; property:value format
What data type is a sequence of text enclosed in single quote marks?
List 4 types of JavaScript operators.
- Arithmetic operator, assignment operator, comparison operator, concatenation operator
Describe a real world Problem you could solve with a Function.
- Temprature conversion between farrenheit to celcius, and vice versa
An if statement checks a __ and if it evaluates to ___, then the code block will execute.
What is the use of an else if?
- to add more conditions to an if else statement
List 3 different types of comparison operators.
- === is strict equality, testing whether the left and right values are identical to one another. !== is strict non-equality, testing whether the lef and right values are not identical to one another. < and > are less than, greater than sign
What is the difference between the logical operator && and ||?
- && means ‘and’, and || means ‘or’
Things I want to know more about
References