code-201-reading-notes

text

when you create a web page, you add tags to the contents of it. These tags provide extra meaning to the page and allow browsers to show users the apropriate structure for the page, and we have two different types of tags:

headings

headings

HTML has six levels of headings, <h1> is used for main headings,<h2> is used for subheading, <h3> is smaller and less important and so on.

paragraph

paragraphs To create a paragraph, surround the words that make up the paragraph with an opening <p> tag and closing </p> tag. And by enclosing words in the tags ** and ** we can makecharacters appear bold. By enclosing words in the tags ** and ** we can make characters appear italic.

superscript and subscript

subsup

line breaks and horizontal rules

semantic markup

There are some text elements that are not intended to affect the structure of your web pages, but they do add extra information to the pages — they are known as semantic markup.

strong and emphasis

quotations

abbreviations and acronyms

citations and definitions

authors details

The <address> element has quite a specific use: to contain contact details for the author of the page.

changes to content

Introducing CSS

CSS allows you to create rules that specify how the content of an element should appear.

css

using external css

The element can be used in an HTML document to tell the browser where to find the CSS file used to style the page and it lives insede the head element. It should use three attributes:

using internal css

You can also include CSS rules within an HTML page by placing them inside a **

Basic JavaScript Instructions

  1. statements A script is a series of instructions that a computer can follow one-by-one. Each individual instruction or step is known as a statement. Statements should end with a semicolon. Some statements are surrounded by curly braces; these are known as code blocks. The closing curly brace is not followed by a semicolon>

blocks

  1. comments You should write comments to explain what your code does. They help make your code easier to read and understand. This can help you and others who read your code.
  1. variables

A script will have to temporarily store the bits of information it needs to do its job. It can store this data in variables. A variable is a good name for this concept because the data stored in a variable can change each time a script runs.

using a variable to store a boolian

boolian

arrays

An array is a special type of variable. It doesn’t just store one value; it stores a list of values.

Decisions and Loops

comparison operators

you can evaluate a situation by comparing one value in the script to what you expect it maight be. The result wil be a boolean.

logical operators

logical

It allowes you compare the results of more than one condition.

loops:

loops check a condition, if it’s true, a code block will run, then the condition will be checked again and if it’s still true, the code block will run again and again until the condition is false. There are three common types of loops, for, while, and do while:

A for loop is a repetition control structure that allows you to write a loop that needs to run a specific number of times. for example, if you want to execute a loop for 12 time, the code will be like that:

for( i = 0; a < 12; i++ )

you can use it if you don’t know how many times the code should run, the code will continue to loop as long as the condition is true.