Reading-notes

HTML Lists, CSS Boxes, JS Control Flow :

js

Lists:

The ordered list is created with the ol element. Each item in the list is placed between an opening li tag and a closing li

The unordered list is created with the ul element. and the same Each item in the list is placed between an opening li tag and a closing li

Definition Lists definition list is created with the dl element and usually consists of a series of terms and their definitions. dt This is used to contain the trm being defined

dd This is used to contain the definition.

threre is also Definition Lists:

definition list is created with the dl element and usually consists of a series of terms and their definitions.

dt This is used to contain the trm being defined

dd This is used to contain the definition.

boxes

js js

By default a box is sized just big enough to hold its contents. To set your own dimensions for a box you can use the height and width properties.

When we use percentages, the size of the box is relative to the size of the browser window or, if the box is encased within another box, it is a percentage of the size of the containing box.

Overflowing Content:

  1. overflow
  2. hidden
  3. scroll

border-style

###border-color

Padding

Margin

Centering Content

Change Inline/Block

CSS treats each HTML element as if it has its own box. and You can use CSS to control the dimensions of a box. also You can also control the borders, margin and padding for each box with CSS.

CREATING AN ARRAY

js

EXPRESSIONS -An expression evaluates into (results in) a single value. Broadly speaking there are two types of expressions.

USING IF … ELSE STATEMENTS if … else statement allows you to provide two sets of code: one set if the condition evaluates to true and another set if the condition is false.

SWITCH STATEMENTS:

js

A switch statement starts with a variable called the switch value. Each case indicates a possible value for this variable and the code that should run if the variable matches that value.

SHORT CIRCUIT VALUES

Logical operators are processed left to right. They short-circuit (stop) as soon as they have a result - but they return the value that stopped the processing (not necessarily true or false

Loops

loops check a condition if it return true the code block will run, then the condition will be checked again ,it repeat until the condition return false.

USING FOR LOOPS

A for loop is often used to loop through the items in an array.

USING WHILE LOOPS

This loop will continue to run for as long as the condition in the parentheses is true.

USING DO WHILE LOOPS

The key difference between a whi 1 e loop and a do whi 1 e loop is that the statements in the code block come before the condition. This means that those statements are run once whether or not the condition is met.