Skip to content

Latest commit

 

History

History
80 lines (50 loc) · 2.85 KB

File metadata and controls

80 lines (50 loc) · 2.85 KB

HTML Texts

HTML contains several elements for defining text with a special meaning.

Text Format

Formatting elements were designed to display special types of text:

Tage Result
< b > Bold text
< strong > Important text
< i > Italic text
< em > Emphasized text
< mark > Marked text
< small > Smaller text
< del > Deleted text
< ins > Inserted text
< sub > Subscript text
< sup > Superscript text

CSS

CSS Image

The element can be used in an HTML document to tell the browser where to find the CSS file used to style the page. It is an empty element (meaning it does not need a closing tag), and it lives inside the element. It should use three attributes:

This specifies the path to the CSS file (which is often placed in a folder called css or styles).

This attribute specifies the type of document being linked to. The value should be text/css.

This specifies the relationship between the HTML page and the file it is linked to. The value should be stylesheet when linking to a CSS file.

<style>

You can also include CSS rules within an HTML page by placing them inside a <style> element, which usually sits inside the element of the page.

The <style> element should use the type attribute to indicate that the styles are specified in CSS. The value should be text/ css.


JavaScript

JavaScript

Variables

JavaScript variables are containers for storing data values.

Data Types

JavaScript variables can hold numbers like 100 and text values like "John Doe".

In programming, text values are called text strings.

JavaScript can handle many types of data, but for now, just think of numbers and strings.

Strings are written inside double or single quotes. Numbers are written without quotes.

If you put a number in quotes, it will be treated as a text string.

Loops

Loops

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

Different Kinds of Loops

  • for : loops through a block of code a number of times
  • for/in : loops through the properties of an object
  • for/of : loops through the values of an iterable object
  • while : loops through a block of code while a specified condition is true
  • do/while - also loops through a block of code while a specified condition is true