Basics of HTML, CSS and JS
Index
Home
Introduction to HTML (Cont.)
Learn CSS
Learn JS
Things I want to know more about
Introduction to HTML (Cont.)
HTML text fundamentals and Advanced text formatting
- Why is it important to use semantic elements in our HTML?
- SEO, Screen readers, expected behaviors. We need to make sure we are using the correct elements, giving our content the correct meaning, function, or appearance.
- How many levels of headings are there in HTML?
- There are six heading elements:
<h1><h2><h3><h4><h5>and<h6>. Each element represents a different level of content in the document;<h1>represents the main heading,<h2>represents subheadings,<h3>represents sub-subheadings, and so on. - Preferably, you should use a single
<h1>per page. - Of the six heading levels available, you should aim to use no more than three per page. It is advisable to spread the content over multiple pages if possible.
- There are six heading elements:
- What are some uses for the
<sup>and<sub>elements?- Dates, chemical formulae, and mathematical equations are a few examples.
- When using the
<abbr>element, what attribute must be added to provide the full expansion of the term?- The
titleattribute.
- The
Learn CSS
How CSS is Structured
- What are ways we can apply CSS to our HTML?
- External stylesheet
<link rel="stylesheet" href="style.css">.- Inside a subdirectory called styles inside the current directory
<link rel="stylesheet" href="styles/style.css"> - Inside a subdirectory called general, which is in a subdirectory called styles, inside the current directory
<link rel="stylesheet" href="styles/general/style.css"> - Go up one directory level, then inside a subdirectory called styles
<link rel="stylesheet" href="../styles/style.css">
- Inside a subdirectory called styles inside the current directory
-
Internal stylesheets
<head> <meta charset="utf-8"> <title>My CSS experiment</title> <style> h1 { color: blue; background-color: yellow; border: 1px solid black; } p { color: red; } </style> </head> - Inline stylesheets
<h1 style="color: blue;background-color: yellow;border: 1px solid black;">Hello World!</h1>or<p style="color:red;">This is my first CSS example</p>
- External stylesheet
- Why should we avoid using inline styles?
- First, it is the least efficient implementation of CSS for maintenance. One styling change might require multiple edits within a single web page. Second, inline CSS also mixes (CSS) presentational code with HTML and content, making everything more difficult to read and understand. Separating code and content makes maintenance easier for all who work on the website.
- 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?
color: black;padding: 5px;
- Which components are considered properties?
colorpadding
Learn JS
- What data type is a sequence of text enclosed in single quote marks?
string
- List 4 types of JavaScript operators.
+-*/====!!==
- Describe a real world Problem you could solve with a Function.
- Any accounting problem ever.
- Any mathmatical problem ever.
- Randomly pick what color icing I want on my cake. but… the cake is a lie.
Making Decisions In Your Code - Conditionals
- An if statement checks a __ and if it evaluates to ___, then the code block will execute.
- condition
- true
- What is the use of an else if?
- It is used to test a specified condition, if it is true, run A, if false, run B.
- List 3 different types of comparison operators.
===Strict equality!==Strict-non-equality>Greater than<Less than<=Less than or equal to>=Greater than or equal to
- What is the difference between the logical operator
&&and||?&&AND; allows you to chain together two or more expressions so that all of them have to individually evaluate to true for the whole expression to return true.||OR; allows you to chain together two or more expressions so that one or more of them have to individually evaluate to true for the whole expression to return true.
Things I want to know more about
- When if ever is it ok to use inline styles?