My HTML Notes

Markup

Elements

<em></em>

<br>

<p></p>

This is an example of a paragraph

This is an example of a line break
inside a paragraph

<mark></mark> <sub></sub> and <sup></sup>

Elements Reivew (Part 1)

Elements seen so far:

Of these elements, the <br> element is the only one that is an empty (or void) element.

Ordered and Unordered Lists

Ordered Lists

  1. Ordered lists list items with numbers
  2. Use <ol></ol> to create an ordered list
  3. <li></li> identifies each list item

Unordered Lists

Nested List

  1. a nested list is a list inside a list
    • This is a nested list item inside a nother list
  2. Nesting lists isn't too hard.

Anchor links

to add a link to a page, use <a href="http://example.net">Link text</a>

  1. a is the element tag, "anchor".
  2. href="http://example.net is the attripute of the anchor element
  3. href is the name of the attribute
  4. "http://example.net" is the value of the attribute
  5. Link text is the content of the element. In this link text of the link

The "anchors" the link to the text

Here is a link to Udacity learning:
Udacity Learning

Adding images

to add an image to a page, use <img src="./file/path" alt="example image">

  1. img is the element tag for images
  2. src="./file/path is the URL location or file path location of the image
  3. alt="example image" is a text description of the image. This is useful for when an image may fail to load.

Below is an example of using an image from a website

html image

Elements Review (Part 2)

Block elements

Block elements are used for large sections of text, such as paragraphs, headlines, or lists; and also for some other features such as video players and tables.

A block element creates a (usually invisible) box in the browser display. By default, this box takes up the full width of the display. The beginning of a block always starts on a new line in the display.

Most block elements have a particular way they are displayed by default: paragraphs have margins around them; lists have bullet-points or numbered items; headlines are printed in large text. There is also a generic block element, div, which has no special defaults.

Inline elements

Inline elements do not create a full-width box on the display. They modify the display of text, or insert other things into the text — such as line breaks, images, or hyperlinks.

Some inline elements require attributes, besides the name of the element itself. Attributes are written inside the opening tag of the element

HTML structure

HTML Boilerplate

<!DOCTYPE html>
<htm lang="en">
    <head>
        <meta charset = "utf-8">
        <title>TITLE</title>
    </head>
                
    <body>
        <h1>
        HEADING
        </h1>
        <p>
            Paragraph
        </p>
    </body>
</html>                
                    

The <body> of the html contains everything displayed on the webpage

the <head> of the html contains: