reading-notes

Aloysious' Codefellows Reading Notes

View the Project on GitHub

Code 201 Reading Notes

Class 3

Class 1 Instructor’s Repo

<== Previous Lesson Next Lesson ==>

<== Home 🏠

HTML Lists, Control Flow with JS, and the CSS Box Model

lists

Lists

Lists CW3 Schools

box model

Boxes

[show every box with this code]

* { border: 1px solid red !important; }

Box Examples

div {

width: 320px;

padding: 10px;

border: 5px solid gray;

margin: 0;

}

320px (width)

20px (left + right padding)

10px (left + right border)

0px (left + right margin)

= 350px

The total width of an element should be calculated like this:

Total element width = width + left padding + right padding + left border + right border + left margin + right margin

The total height of an element should be calculated like this:

Total element height = height + top padding + bottom padding + top border + bottom border + top margin + bottom margin

Boxes CW3 Schools]

arrays

Array Properties

Property Description
constructor Returns the function that created the Array object’s prototype
length Sets or returns the number of elements in an array
prototype Allows you to add properties and methods to an Array object

Values in an array are accessed if they are in a numbered list. It is important to know that the numbering of this list starts a\t zero (not one).

Array Methods CW3 Schools

Boolean Practice Class 3

Reading

From the Duckett HTML book:

From the Duckett JS book:

<== Previous Lesson Next Lesson ==>

<== Home 🏠