Read03 - HTML Lists, CSS Boxes, JS Control Flow:
Lists:
- There are three types of HTML lists: ordered,
unordered, and definition.
- Ordered lists use numbers.
- Unordered lists use bullets.
- Definition lists are used to define terminology.
- Lists can be nested inside one another.
Boxes:
- CSS treats each HTML element as if it has its own box.
- You can use CSS to control the dimensions of a box.
- You can also control the borders, margin and padding
for each box with CSS.
- It is possible to hide elements using the display and
visibility properties.
- Block-level boxes can be made into inline boxes, and
inline boxes made into block-level boxes.
- Legibility can be improved by controlling the width of
boxes containing text and the leading.
- CSS3 has introduced the ability to create image
borders and rounded borders.
Arrays:
- An array is a special type of variable. It doesn’t
just store one value; it stores a list or a set of values that
are related to each other.
- Arrays are especially helpful when you do not know how many items a list will contain.
- Technique for creating an array: array literal, array constructor
array literal: var name = [‘val1’,’val2’,val3’];
array constructor: each value on a separate line, uses the new keyword followed by Array();
- Each item in an array is automatically given a number called an index.
This can be used to access specific items in the array.
- index values start at 0 (not 1).
Decisions and Loops:
- if … else statements allow you to run one set of code
if a condition is true, and another if it is false.
- switch statements allow you to compare a value
against possible outcomes (and also provides a default
option if none match).
- Data types can be coerced from one type to another.
- All values evaluate to either truthy or falsy.
- There are three types of loop: for, while, and
do … while. Each repeats a set of statements.
I’ve read pages carefully and found the summary for each chapter is good enough so I typed most of it.