reading-notes


Project maintained by Razan-am Hosted on GitHub Pages — Theme by mattgraham

HTML & CSS

Chapter 3: “Lists”

1. Ordered Lists:

Example:

<ol>

<li>Chop potatoes into quarters</li>

<li>Simmer in salted water for 15-20 minutes until tender</li>

</ol>

2. Unordered Lists:

Example:

<ul>

<li>1kg King Edward potatoes</li>

<li>100ml milk</li>

<li>50g salted butter</li>

</ul>

3. Definition Lists:

Example:

<dl>

<dt>Sashimi</dt>

<dd>Sliced raw fish that is served with condiments such as shredded daikon radish or ginger root, wasabi and soy sauce</dd>

<dt>Scale</dt>

<dd>A device used to accurately measure the weight of ingredients</dd>

<dd>A technique by which the scales are removed from the skin of a fish</dd>

</dl>

- There is another type called Nested Lists and it is used when you put a second list inside an <li> element to create a sublist or nested list.

Examples:

<ul>

<li>Mousses</li>

<li>Pastries

<ul>

<li>Croissant</li>

<li>Mille-feuille</li>

<li>Palmier</li>

<li>Profiterole</li>

</ul>

</li>

<li>Tarts</li>

</ul>

<- So an overall about the lists:>


Chapter 13: “Boxes”

1. Control the dimensions of your boxes with (width, height):

Example:

box {

height: 300px;

width: 300px;}

Example:

td.description {

min-width: 450px;

max-width: 650px;}

Example:

p {

min-height: 10px;

max-height: 30px;}

2. Border, Margin & Padding:

Border

- border-width:is used to control the width of a border.

You can only use pixels or using one of the following values: thin medium thick,to give the value fot the width.

Example:

p.one {

border-width: 2px;}

p.two {

border-width: thick;}

p.three {

border-width: 1px 4px 12px 4px;}

- border-style: control the style of a border, such as solid,dotted,dashed,double,groove,ridge,inset,outset,and hidden / none for no border is shown.

Example:

p.one {border-style: solid;}

p.two {border-style: dotted;}

p.three {border-style: dashed;}

p.four {border-style: double;}

- border-color:specify the color of a border using either RGB values, hex codes or CSS color names.

Example:

p.one {

border-color: #0088dd;}

p.two {

border-color: #bbbbaa #111111 #ee3e80 #0088dd;}

You can o individually control the colors of the borders on different sides of a box.

- shorthand-border:to specify the width, style and color of a border in one property.

Example:

p {

width: 250px;

border: 3px dotted #0088dd;}

Padding

Example:

p {

width: 275px;

border: 2px solid #0088dd;}

p.example {

padding: 10px;}

You can specify different values for each side of a box.

Margin

Example:

p {

width: 200px;

border: 2px solid #0088dd;

padding: 10px;}

p.example {

margin: 20px;}

You can specify values for each side of a box.


<Centering Content>

Example:

body {

text-align: center;}

p {

width: 300px;

padding: 50px;

border: 20px solid #0088dd;}

p.example {

margin: 10px auto 10px auto;

text-align: left;}


<Change Inline/Block>

Example:

li {

display: inline;

margin-right: 10px;}

li.coming-soon {

display: none;}

3. Show and hide boxes:

Example:

li {

visibility: hidden;}


There is another options to display the boxes using: - CSS3-Border Images:It takes a backgroundimage and slices it into nine pieces.

This property requires three pieces of information:

  1. The URL of the image
  2. Where to slice the image
  3. What to do with the straight edges; the possible values are:
    • stretch stretches the image
    • repeat repeats the image
    • round like repeat but if the tiles do not fit exactly, scales the tile image so they will.

Example:

p.two {

-moz-border-image: url("images/dots.gif") 11 11 11 11 round;

-webkit-border-image: url("images/dots.gif") 11 11 11 11 round;

border-image: url("images/dots.gif") 11 11 11 11 round;}

The box must also have a border width for the image to be shown.

- CSS3- Box Shadows:The box-shadow property allows you to add a drop shadow around a box.

The inset keyword can also be used before these values to create an inner-shadow.

Example:

p {`

-moz-box-shadow: 5px 5px 5px #777777;

-webkit-box-shadow: 5px 5px 5px #777777;

box-shadow: 5px 5px 5px #777777;}

- CSS3-Border-radius(rounded Corners):

You can specify individual values for each corner of a box using:

  • border-top-right-radius
  • border-bottom-right-radius
  • border-bottom-left-radius
  • border-top-left-radius

Example:

p {

border: 5px solid #cccccc;

padding: 20px;

width: 275px;

text-align: center;

border-radius: 10px;}

- CSS3-Elliptical Shapes (border-radius):For more complex shapes, you can specify different distances for the horizontal and the vertical parts of the rounded corners.

Example:

p.one {

border-top-left-radius: 80px 50px;}


An overall about boxes:

==================================================================================================================

JAVASCRIPT

Chapter 2: “Basic JavaScript Instructions”

+ VALUES IN ARRAYS :Values in an array are accessed as if they are in a numbered list. It is important to know that the numbering of this list starts at zero (not one).

- NUMBERING ITEMS IN AN ARRAY : Each item in an array is automatically given a number called an index.

var colors; colors= ['white ' , 'black ' , ' custom '];

INDEX VALUE ` o ‘white ‘ 1 ‘black’ 2 ‘ custom’ `

- ACCESSING ITEMS IN AN ARRAY : To retrieve the third item on the list

>var itemThree; itemThree = col ors [2] ;

-NUMBER OF ITEMS IN AN ARRAY : Each array has a property called length, which holds the number of items in the array.

var numColors ; ` numColors =colors. length;`

// Create the array var colors = [‘white’,’black’ ,’custom’]; // Update the third item in the array colors[2] = ‘beige ‘ ; //Get the element with an id of colors var el = document .getElementByid(‘ colors’) ; //Replace with third item from the array el .textContent = colors[2];


Chapter 4: “Decisions and Loops”

- Switch statments:

A switch statement starts with a variable called the switch value.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.

switch (level) {

case 'One ':

title= 'Level 1 ' ;

break;

case 'Two':

title = ' Level 2 ' ;

break;

case ' Three' :

title = 'Level 3' ;

break ;

default :

title= 'Test';

break;

}

You have a default option that is run if none of the cases match.

If a match is found, that code is run; then the break statement stops the rest of the switch statement running (providing better performance than multiple if statements).

==========================================================================================

References:

@Jon Duckett/HTML & CSS

@Jon Duckett/JAVASCRIPT