Class 2 Notes
Why this topic matters as it relates to what you are studying in this module.
this us the very basics of HTML CSS and Javascript. We are still defining functions as of now but having a firm grasp on what these terms mean and how they could be used will allow us to expand to more complex questions later.
Why is it important to use semantic elements in our HTML?
Semantics give a clear description of what each element does. iwthout it our code is vague and can be difficult for others to read or edit.
How many levels of headings are there in HTML?
5
What are some uses for the and elements?
using smaller lettering for chemical elements or dates.
When using the element, what attribute must be added to provide the full expansion of the term?
The title attribute will be used here.
What are ways we can apply CSS to our HTML?
Create different coloros for words backgrounds, to change shape or placements of pictures or paragraphs.
Why should we avoid using inline styles?
It makes code difficult to edit later on.
Review the block of code below and answer the following questions:
h2 {
color: black;
padding: 5px;
}
What is representing the selector?
The sub headings
Which components are the CSS declarations?
color: black;
padding: 5px;
Which components are considered properties?
Color & Padding
What data type is a sequence of text enclosed in single quote marks?
A String
List 4 types of JavaScript operators.
Plus sign, minus sign, multiplication signs and division signs.
Describe a real world Problem you could solve with a Function.
A function could be used on an alcohol sight to vet the user and make sure they are over 21 years of age before the go on the sight.
An if statement checks a __ and if it evaluates to ___, then the code block will execute.
For true or fals and if it evaluates true, it wille execute.
What is the use of an else if?
If the statement is false
List 3 different types of comparison operators.
According to Mozilla.Org
- === 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.
What is the difference between the logical operator && and ||?
Almost opposites in the && means that everything must be true for it to be true
| |
indicates if anything either value is true then its true |