Reading Day 3
June 16, 2020
Chapter 3: Lists
- ordered lists use the ol tag
- unordered lists use the ul tag
- both use li as list item.
- if creating an online glossary, that is a definition list. use the dl, dt, and dd tags to create.
- to create a nested list, use the ul or ol tag inside an li
- lists are easy and fun.
Chapter 13: Boxes
- specifying the size of a box using CSS means defining pixels, percentages, ems. most of the time px is the best method.
- CSS can also be used to set the min and max width, as well as min and max height. p. 305.
- you can control the overflow of content using hidden and scroll properties.
- every box has border, margin, and padding that can be used to improve design and readability. Really good chart on 307-308.
- border-width, border-style, and border-color can also be adjusted. These 3 can be shorthanded inside the border property.
- padding can also be shorthanded as top,right,bottom,left respectively.
Chapter 4: Decisions and Loops
- if else statements are conditional. if the if statement is false, the else statement block is executed.
- switch statements give you multiple options. illustrated on 164.
- falsy and truthy statements are treated as if they are false or true. I don’t quite get this part.
- for loops run a specific number of times checking for a condition, usually with a counter.
- while loops keep running as long as the condition is true.
- do while loops run curly brace statements at least once, even if the condition returns false.
- for loops using the counter as a condition will use var i=0, i<10, and i++. p. 171 details the definitions.
- the standard statement is for (var i=0; i< 10; i++) {
document.write(i);
}
- for loops are generally used to loop through an array.
- while loops are used repeating a block of code while a condition is true.
- do while loops - I still don’t understand what this does. I need an example of its practical use on a site.
- example code for a loop inside an if statement is on p 180,181.