View on GitHub

reading-notes

SWITCH STATEMENTS

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.

syntaxswitch

At the end of each case is the break keyword.

The Different between If-statement and Switch

The if statement evaluates integer, character, pointer or floating-point type or boolean type. On the other hand, switch statement evaluates only character or an integer datatype.

Loops

Loops chech the condition, if it true a code block will run, then the condition will be checked again if it still true the code block will run again, it repeated until the condition return false.

For Loop

if you want to run the same code over and over again, each time with a different value.

forsyntax

You will commonly see these two keywords used with loops:

While loop

loops through a block of code as long as a specified condition is true.

Syntax

while(condition)

{

statements;

}

whileloop

Do While loop

will execute the code block once, before checking if the condition is true, then it will repeat the loop as long as the condition is true.

Syntax

do

{

statements; } while(condition);

dowhile


Lists

HTML provides us with three different types:

Order orderalpha nestedorder

unorder nestedunorder

Definitionlist


Box Dimensions

The box-sizing property allows us to include the padding and border in an element’s total width and height.

Box

Border width

borderstyle

borderwidth

bordercolor

indivisualborder


Padding

properties are used to generate space around an element’s content, inside of any defined borders.

padding

Margin

properties are used to create space around elements, outside of any defined borders.

margin

Centering Content

If you want to center a box on the page (or center it inside the element that it sits in).

centerbox

inline

This causes a block-level element to act like an inline element.

inline

Image border

borderimage

Box shadow

shadowbox

Border radius

borderradius