reading-notes

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

Lists

< ol > The ordered list is created with the < ol > element. < li > Each item in the list is placed between an opening < li > tag and a closing < /li > tag. (The li stands for list item.) list

*< ul > The unordered list is created with the < ul > element. < li > unorder list

< dl > The definition list is created with the < dl > element and usually consists of a series of terms and their definitions. Inside the < dl > element you will usually see pairs of < dt > and < dd > elements. < dt > This is used to contain the term being defined (the definition term). < dd > This is used to contain the definition.


CSS Box Model

All HTML elements can be considered as boxes.

The CSS Box Model In CSS, the term “box model” is used when talking about design and layout.

The CSS box model is essentially a box that wraps around every HTML element. It consists of: margins, borders, padding, and the actual content. The image below illustrates the box model:

box

explanation of the different parts:

Width and Height of an Element In order to set the width and height of an element correctly in all browsers, you need to know how the box model works.

JavaScript

JavaScript is a programming language that adds interactivity to your website. This happens in games, in the behavior of responses when buttons are pressed or with data entry on forms; with dynamic styling; with animation, etc.

let myVariable;

Variable Explanation Example
String This is a sequence of text known as a string. To signify that the value is a string, enclose it in single quote marks. let myVariable = ‘Bob’;
Number This is a number. Numbers don’t have quotes around them. let myVariable = 10;
Boolean This is a True/False value. The words true and false are special keywords that don’t need quote marks. let myVariable = true;
Array This is a structure that allows you to store multiple values in a single reference. let myVariable = [1,’Bob’,’Steve’,10]; Refer to each member of the array like this: myVariable[0], myVariable[1], etc.
Object This can be anything. Everything in JavaScript is an object and can be stored in a variable. Keep this in mind as you learn. let myVariable = document.querySelector(‘h1’);
All of the above examples too.