JavaScript create h1 element

If you are the content provider, read HTML. If you are the graphic designer, read CSS. If you are a programmer and want to add dynamic effects to your web page, read JavaScript. But if you operate in OMO (one-man-operated) and are expected to create a reasonably good-looking website, you need to understand HTML, CSS and JavaScript. This is the reason that I combine both the HTML and CSS in this article as they are inseparable.

To create an OMO website, I suggest that:

  1. Understand HTML, CSS and JavaScript thoroughly.
  2. Pick an authoring tool: Use Dreamweaver if you can afford. Otherwise, find a free source-code editor (such as VS Code, Sublime Text, Sublime Text, NotePad++). For programmers, Eclipse/NetBeans/VSCode are good choice for HTML/CSS/JavaScript as they perform syntax checking and provide auto-code-complete.
  3. Design and organize your page. Decide on the look and feel of your website. How many columns? What are the major sections (e.g., header, navigation menu, main content, sidebar, table of content, footer)? Do you need a navigation menu or panel? What is your theme (colors, fonts)? And so on.
  4. Take a close look at your favorite websites!!! CSS is humongous and complex! You can't invent this wheel! Use F12 Debugger to inspect HTML/CSS of your favorite websites.
    Use a CSS framework, such as BootStrap, to jump-start your design.
  5. Start with an initial CSS design. Website design begins with CSS, NOT HTML?!. Work on your CSS:
    1. Partition your web page into logical section via

      (or HTML5',,

      ,), such as header, content, footer. Assign an

      The h1 tags enclose a heading level 1

      The p tags is used to markup a paragraph.

      1 to

      that is unique (e.g., "

      The h1 tags enclose a heading level 1

      The p tags is used to markup a paragraph.

      2", "

      The h1 tags enclose a heading level 1

      The p tags is used to markup a paragraph.

      3". Assign a common classname to sections (non-unique) that share the same style (e.g., "

      The h1 tags enclose a heading level 1

      The p tags is used to markup a paragraph.

      4", "

      The h1 tags enclose a heading level 1

      The p tags is used to markup a paragraph.

      5"). Write the CSS id-selectors and class-selectors (e.g.,

      The h1 tags enclose a heading level 1

      The p tags is used to markup a paragraph.

      6

      The h1 tags enclose a heading level 1

      The p tags is used to markup a paragraph.

      7

      The h1 tags enclose a heading level 1

      The p tags is used to markup a paragraph.

      8) for common tags (such as

      The h1 tags enclose a heading level 1

      The p tags is used to markup a paragraph.

      9,
      //validator.w3.org/.
    2. W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
    3. Specifications:
      • HTML5 @ //www.w3.org/TR/html5/.
      • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
    4. 02 character encoding scheme, which is compatible with ASCII code for English alphabets and allow you to include other Unicode characters (such as Chinese, Japanese and Korean) efficiently.
      When saving your file, you need to choose "UTF-8 encoding" in the "save-as" dialog menu.
    5. The

      See how the extra white spaces, tabs and line-breaks are ignored by the browser.

      4 element (Line 5) provides a descriptive title to the page. The browser displays the title on the title-bar of the tab/window.
  6. In the

    See how the extra white spaces, tabs and line-breaks are ignored by the browser.

    7 section:
    1. The Lists and Hyperlinks

      Lists and Hyperlinks

      There are two types of lists in HTML:

      1. Ordered List.
      2. Unordered List.

      This is a nested unordered list of links:

      • Online Validator:
        • W3C Online HTML Validator @ //validator.w3.org/.
        • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
      • Specifications:
        • HTML5 @ //www.w3.org/TR/html5/.
        • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
      05 container tags (Line 8) mark the enclosing texts as Level-1 Heading. There are six levels of heading in HTML, from Lists and Hyperlinks

      Lists and Hyperlinks

      There are two types of lists in HTML:

      1. Ordered List.
      2. Unordered List.

      This is a nested unordered list of links:

      • Online Validator:
        • W3C Online HTML Validator @ //validator.w3.org/.
        • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
      • Specifications:
        • HTML5 @ //www.w3.org/TR/html5/.
        • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
      05 (largest) to

      See how the extra white spaces, tabs and line-breaks are ignored by the browser.

      4. Line 11 uses a Lists and Hyperlinks

      Lists and Hyperlinks

      There are two types of lists in HTML:

      1. Ordered List.
      2. Unordered List.

      This is a nested unordered list of links:

      • Online Validator:
        • W3C Online HTML Validator @ //validator.w3.org/.
        • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
      • Specifications:
        • HTML5 @ //www.w3.org/TR/html5/.
        • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
      08 (Heading Level-3).
    2. The

      //validator.w3.org/.
    3. W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
    4. Specifications:
      • HTML5 @ //www.w3.org/TR/html5/.
      • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
    5. 10 container tags (Line 10 and 12) mark the enclosing texts as a paragraph. Lists and Hyperlinks

      Lists and Hyperlinks

      There are two types of lists in HTML:

      1. Ordered List.
      2. Unordered List.

      This is a nested unordered list of links:

      • Online Validator:
        • W3C Online HTML Validator @ //validator.w3.org/.
        • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
      • Specifications:
        • HTML5 @ //www.w3.org/TR/html5/.
        • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
      10 is the most frequently-used tag in HTML.
    6. The Lists and Hyperlinks

      Lists and Hyperlinks

      There are two types of lists in HTML:

      1. Ordered List.
      2. Unordered List.

      This is a nested unordered list of links:

      • Online Validator:
        • W3C Online HTML Validator @ //validator.w3.org/.
        • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
      • Specifications:
        • HTML5 @ //www.w3.org/TR/html5/.
        • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
      12 tags (nested under the Lists and Hyperlinks

      Lists and Hyperlinks

      There are two types of lists in HTML:

      1. Ordered List.
      2. Unordered List.

      This is a nested unordered list of links:

      • Online Validator:
        • W3C Online HTML Validator @ //validator.w3.org/.
        • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
      • Specifications:
        • HTML5 @ //www.w3.org/TR/html5/.
        • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
      10 in Line 10) specify "strong emphasis" for its content - rendered in bold by the browser. Similarly, the nested Lists and Hyperlinks

      Lists and Hyperlinks

      There are two types of lists in HTML:

      1. Ordered List.
      2. Unordered List.

      This is a nested unordered list of links:

      • Online Validator:
        • W3C Online HTML Validator @ //validator.w3.org/.
        • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
      • Specifications:
        • HTML5 @ //www.w3.org/TR/html5/.
        • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
      14 tags (Line 12) specify "emphasis" rendered in italic; and

      See how the extra white spaces, tabs and line-breaks are ignored by the browser.

      4 (HTML 5) requests for highlight.

View Page Source

You can read the HTML source code by right-clicking on the page and select "View Source" (or "View Page Source", or "Show Page Source"). Try it out.

Note: For macOS's Safari, you may need to enable "Show Page Source" via "Preferences" ⇒ Advanced ⇒ "Show Develop menu in menu bar".

Don't Load the Cached Page (Ctrl-F5)!

Most browsers cache web pages (and the associated images, style sheets, JavaScripts) to boost the speed for web surfing. When you modify and reload a page (via the refresh key F5), the browser might retrieve the un-modified cache copy. To force the browser to reload the page (and all its associated resources) from the source, hit Ctrl-F5.

Most Frequently-Used HTML Elements

The most frequently-used HTML elements are:

  • block elements:

    (paragraph),

    //validator.w3.org/.

  • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
  • Specifications:
    • HTML5 @ //www.w3.org/TR/html5/.
    • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
  • How it Works?
    1. The (in Line 3) is an HTML comment. Comments are ignored by the browsers, but are important to provide explanations to the readers as well as the author.
    2. There are two types of lists in HTML: ordered list and unordered list. An ordered list is marked by Lists and Hyperlinks

      Lists and Hyperlinks

      There are two types of lists in HTML:

      1. Ordered List.
      2. Unordered List.

      This is a nested unordered list of links:

      • Online Validator:
        • W3C Online HTML Validator @ //validator.w3.org/.
        • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
      • Specifications:
        • HTML5 @ //www.w3.org/TR/html5/.
        • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
      23 and displayed with numbers; while a unordered list is marked by Lists and Hyperlinks

      Lists and Hyperlinks

      There are two types of lists in HTML:

      1. Ordered List.
      2. Unordered List.

      This is a nested unordered list of links:

      • Online Validator:
        • W3C Online HTML Validator @ //validator.w3.org/.
        • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
      • Specifications:
        • HTML5 @ //www.w3.org/TR/html5/.
        • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
      24 and displayed with bullets. Each of the list items is marked by
    3. See how the extra white spaces, tabs and line-breaks are ignored by the browser.

      4
    4. .
    5. You can nest a list inside another list, by placing the complete inner list definition inside a list item
    6. See how the extra white spaces, tabs and line-breaks are ignored by the browser.

      4
    7. of the outer list.
    8. Hyperlink is marked by

      //validator.w3.org/.
    9. W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
    10. Specifications:
      • HTML5 @ //www.w3.org/TR/html5/.
      • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
    11. 28 provides the destination URL of the link.

    Example 3: Tables and Images

    Table and Images

    Table and Images

    Logo of Languages S/No Language Logo
    1. HTML5 //validator.w3.org/.
  • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
  • Specifications:
    • HTML5 @ //www.w3.org/TR/html5/.
    • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
  • 31 specifies the path (or url) for the image source file; Lists and Hyperlinks

    Lists and Hyperlinks

    There are two types of lists in HTML:

    1. Ordered List.
    2. Unordered List.

    This is a nested unordered list of links:

    • Online Validator:
      • W3C Online HTML Validator @ //validator.w3.org/.
      • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
    • Specifications:
      • HTML5 @ //www.w3.org/TR/html5/.
      • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
    32 gives the alternative text if the image cannot be displayed. I used relative path in the Lists and Hyperlinks

    Lists and Hyperlinks

    There are two types of lists in HTML:

    1. Ordered List.
    2. Unordered List.

    This is a nested unordered list of links:

    • Online Validator:
      • W3C Online HTML Validator @ //validator.w3.org/.
      • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
    • Specifications:
      • HTML5 @ //www.w3.org/TR/html5/.
      • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
    31, where " Lists and Hyperlinks

    Lists and Hyperlinks

    There are two types of lists in HTML:

    1. Ordered List.
    2. Unordered List.

    This is a nested unordered list of links:

    • Online Validator:
      • W3C Online HTML Validator @ //validator.w3.org/.
      • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
    • Specifications:
      • HTML5 @ //www.w3.org/TR/html5/.
      • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
    34" denotes the parent directory. You need to find some images, store them and figure out your own relative path.
  • The

    //validator.w3.org/.
  • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
  • Specifications:
    • HTML5 @ //www.w3.org/TR/html5/.
    • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
  • 36 and Lists and Hyperlinks

    Lists and Hyperlinks

    There are two types of lists in HTML:

    1. Ordered List.
    2. Unordered List.

    This is a nested unordered list of links:

    • Online Validator:
      • W3C Online HTML Validator @ //validator.w3.org/.
      • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
    • Specifications:
      • HTML5 @ //www.w3.org/TR/html5/.
      • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
    37 specify the width and height of the image displayed area. They are used here to resize the images for consistent display.
  • In the

    See how the extra white spaces, tabs and line-breaks are ignored by the browser.

    6 section, I added some so-called style rules under the

    //validator.w3.org/.
  • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
  • Specifications:
    • HTML5 @ //www.w3.org/TR/html5/.
    • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
  • 40(e.g.,

    , Lists and Hyperlinks

    Lists and Hyperlinks

    There are two types of lists in HTML:

    1. Ordered List.
    2. Unordered List.

    This is a nested unordered list of links:

    • Online Validator:
      • W3C Online HTML Validator @ //validator.w3.org/.
      • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
    • Specifications:
      • HTML5 @ //www.w3.org/TR/html5/.
      • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
    41). The tag-name shall be in lowercase.

    Tag's Attributes

    Attributes, in the form of Lists and Hyperlinks

    Lists and Hyperlinks

    There are two types of lists in HTML:

    1. Ordered List.
    2. Unordered List.

    This is a nested unordered list of links:

    • Online Validator:
      • W3C Online HTML Validator @ //validator.w3.org/.
      • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
    • Specifications:
      • HTML5 @ //www.w3.org/TR/html5/.
      • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
    42 pairs can be included in the opening tag to provide additional information about the element.

    Example 1: In, the attribute

    See how the extra white spaces, tabs and line-breaks are ignored by the browser.

    5 specifies the natural language for this document.

    Example 2: In

    //validator.w3.org/.

  • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
  • Specifications:
    • HTML5 @ //www.w3.org/TR/html5/.
    • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
  • 45 specifies the character encoding scheme.

    Example 3: An

    //validator.w3.org/.

  • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
  • Specifications:
    • HTML5 @ //www.w3.org/TR/html5/.
    • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
  • 31" specifies the source-URL of the image; " Lists and Hyperlinks

    Lists and Hyperlinks

    There are two types of lists in HTML:

    1. Ordered List.
    2. Unordered List.

    This is a nested unordered list of links:

    • Online Validator:
      • W3C Online HTML Validator @ //validator.w3.org/.
      • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
    • Specifications:
      • HTML5 @ //www.w3.org/TR/html5/.
      • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
    32" specifies an alternate text, if the image cannot be displayed; " Lists and Hyperlinks

    Lists and Hyperlinks

    There are two types of lists in HTML:

    1. Ordered List.
    2. Unordered List.

    This is a nested unordered list of links:

    • Online Validator:
      • W3C Online HTML Validator @ //validator.w3.org/.
      • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
    • Specifications:
      • HTML5 @ //www.w3.org/TR/html5/.
      • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
    36" and " Lists and Hyperlinks

    Lists and Hyperlinks

    There are two types of lists in HTML:

    1. Ordered List.
    2. Unordered List.

    This is a nested unordered list of links:

    • Online Validator:
      • W3C Online HTML Validator @ //validator.w3.org/.
      • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
    • Specifications:
      • HTML5 @ //www.w3.org/TR/html5/.
      • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
    37" specify the width and height of the image displayed area.

    Some of the attributes are mandatory (e.g., the " Lists and Hyperlinks

    Lists and Hyperlinks

    There are two types of lists in HTML:

    1. Ordered List.
    2. Unordered List.

    This is a nested unordered list of links:

    • Online Validator:
      • W3C Online HTML Validator @ //validator.w3.org/.
      • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
    • Specifications:
      • HTML5 @ //www.w3.org/TR/html5/.
      • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
    31" and " Lists and Hyperlinks

    Lists and Hyperlinks

    There are two types of lists in HTML:

    1. Ordered List.
    2. Unordered List.

    This is a nested unordered list of links:

    • Online Validator:
      • W3C Online HTML Validator @ //validator.w3.org/.
      • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
    • Specifications:
      • HTML5 @ //www.w3.org/TR/html5/.
      • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
    32" attributes of the

    //validator.w3.org/.
  • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
  • Specifications:
    • HTML5 @ //www.w3.org/TR/html5/.
    • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
  • 36" and " Lists and Hyperlinks

    Lists and Hyperlinks

    There are two types of lists in HTML:

    1. Ordered List.
    2. Unordered List.

    This is a nested unordered list of links:

    • Online Validator:
      • W3C Online HTML Validator @ //validator.w3.org/.
      • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
    • Specifications:
      • HTML5 @ //www.w3.org/TR/html5/.
      • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
    37" attributes of the

    //validator.w3.org/.
  • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
  • Specifications:
    • HTML5 @ //www.w3.org/TR/html5/.
    • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
  • 57 Lists and Hyperlinks

    Lists and Hyperlinks

    There are two types of lists in HTML:

    1. Ordered List.
    2. Unordered List.

    This is a nested unordered list of links:

    • Online Validator:
      • W3C Online HTML Validator @ //validator.w3.org/.
      • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
    • Specifications:
      • HTML5 @ //www.w3.org/TR/html5/.
      • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
    58 pairs. The Lists and Hyperlinks

    Lists and Hyperlinks

    There are two types of lists in HTML:

    1. Ordered List.
    2. Unordered List.

    This is a nested unordered list of links:

    • Online Validator:
      • W3C Online HTML Validator @ //validator.w3.org/.
      • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
    • Specifications:
      • HTML5 @ //www.w3.org/TR/html5/.
      • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
    59 should be enclosed in single or double quotes for XHTML/XML compliance (although HTML5 does not enforce it).

    HTML Elements

    An HTML element consists of the opening and closing tags, and the content in between, e.g.,

    Lists and Hyperlinks

    Lists and Hyperlinks

    There are two types of lists in HTML:

    1. Ordered List.
    2. Unordered List.

    This is a nested unordered list of links:

    • Online Validator:
      • W3C Online HTML Validator @ //validator.w3.org/.
      • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
    • Specifications:
      • HTML5 @ //www.w3.org/TR/html5/.
      • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
    60

    , Lists and Hyperlinks

    Lists and Hyperlinks

    There are two types of lists in HTML:

    1. Ordered List.
    2. Unordered List.

    This is a nested unordered list of links:

    • Online Validator:
      • W3C Online HTML Validator @ //validator.w3.org/.
      • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
    • Specifications:
      • HTML5 @ //www.w3.org/TR/html5/.
      • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
    61.

    There are two types of elements:

    1. Container Element: A container element has an opening tag Lists and Hyperlinks

      Lists and Hyperlinks

      There are two types of lists in HTML:

      1. Ordered List.
      2. Unordered List.

      This is a nested unordered list of links:

      • Online Validator:
        • W3C Online HTML Validator @ //validator.w3.org/.
        • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
      • Specifications:
        • HTML5 @ //www.w3.org/TR/html5/.
        • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
      40 that activates an effect to its content, and a matching closing tag Lists and Hyperlinks

      Lists and Hyperlinks

      There are two types of lists in HTML:

      1. Ordered List.
      2. Unordered List.

      This is a nested unordered list of links:

      • Online Validator:
        • W3C Online HTML Validator @ //validator.w3.org/.
        • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
      • Specifications:
        • HTML5 @ //www.w3.org/TR/html5/.
        • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
      63 to discontinue the effect. In other words, container elements apply formatting to their contents. For example:

      The h1 tags enclose a heading level 1

      The p tags is used to markup a paragraph.

    2. Void Element (or Standalone Element or Empty Element): A void element does not enclose content but is used to achieve a certain effect, e.g.,

      //validator.w3.org/.
    3. W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
    4. Specifications:
      • HTML5 @ //www.w3.org/TR/html5/.
      • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
    5. 67 in the opening tag. For examples:
      //validator.w3.org/.
    6. W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
    7. Specifications:
      • HTML5 @ //www.w3.org/TR/html5/.
      • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
    8. 67 for brevity, e.g.,

      //validator.w3.org/.
    9. W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
    10. Specifications:
      • HTML5 @ //www.w3.org/TR/html5/.
      • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
    11. 83

      . It is important to properly nest the elements, e.g., the sequence Lists and Hyperlinks

      Lists and Hyperlinks

      There are two types of lists in HTML:

      1. Ordered List.
      2. Unordered List.

      This is a nested unordered list of links:

      • Online Validator:
        • W3C Online HTML Validator @ //validator.w3.org/.
        • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
      • Specifications:
        • HTML5 @ //www.w3.org/TR/html5/.
        • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
      84 is invalid.

      A valid HTML document exhibits a tree structure (called DOM or Document Object Model), with the element as the root element of the document tree, with two child elements: and .

      [TODO] Draw the DOM tree for one of the examples.

      Rendering HTML Pages

      Browsers follow these rules when rendering HTML documents:

      1. In HTML5, the tag-names are NOT case sensitive. I recommend using lowercase, as it is easier to type and XHTML compliance. (XHTML/XML is case sensitive.)
      2. Blanks, tabs, new-lines and carriage-returns are collectively known as white spaces. "Extra" white spaces are ignored. That is, only the first white space is recognized and displayed. For example,

        See how the extra white spaces, tabs and line-breaks are ignored by the browser.

        produces the following single-line output on screen with words separated by a single space:

        See how the extra white spaces, tabs and line-breaks are ignored by the browser.


        You need to use the paragraph tag Lists and Hyperlinks

        Lists and Hyperlinks

        There are two types of lists in HTML:

        1. Ordered List.
        2. Unordered List.

        This is a nested unordered list of links:

        • Online Validator:
          • W3C Online HTML Validator @ //validator.w3.org/.
          • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
        • Specifications:
          • HTML5 @ //www.w3.org/TR/html5/.
          • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
        10 to lay out a paragraph; or insert a manual line-break tag

        //validator.w3.org/.
      3. W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
      4. Specifications:
        • HTML5 @ //www.w3.org/TR/html5/.
        • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
      5. 10 leaves additional space after the paragraph; while

        //validator.w3.org/.
      6. W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
      7. Specifications:
        • HTML5 @ //www.w3.org/TR/html5/.
        • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
      8. 89 (which stands for non-breaking space). For example, Lists and Hyperlinks

        Lists and Hyperlinks

        There are two types of lists in HTML:

        1. Ordered List.
        2. Unordered List.

        This is a nested unordered list of links:

        • Online Validator:
          • W3C Online HTML Validator @ //validator.w3.org/.
          • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
        • Specifications:
          • HTML5 @ //www.w3.org/TR/html5/.
          • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
        0

        This is a paragraph.

        Another paragraph
        with a line-break in between and more spaces     before this.

      The Basic Document Skeleton

      The Element and its Child Elements and

      An HTML document has the following skeleton:

      Lists and Hyperlinks

      Lists and Hyperlinks

      There are two types of lists in HTML:

      1. Ordered List.
      2. Unordered List.

      This is a nested unordered list of links:

      • Online Validator:
        • W3C Online HTML Validator @ //validator.w3.org/.
        • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
      • Specifications:
        • HTML5 @ //www.w3.org/TR/html5/.
        • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
      1

      The

      See how the extra white spaces, tabs and line-breaks are ignored by the browser.

      4 container element defines the extent of an HTML document.

      There are two sections:

      See how the extra white spaces, tabs and line-breaks are ignored by the browser.

      6 and

      See how the extra white spaces, tabs and line-breaks are ignored by the browser.

      7:

      1. ... container element defines the

        See how the extra white spaces, tabs and line-breaks are ignored by the browser.

        6 section, which contains descriptions and meta-information of the HTML document. Browsers interpret these descriptions to properly display the body content.
      2. ... container element defines the

        See how the extra white spaces, tabs and line-breaks are ignored by the browser.

        7 section, which encloses the content that users actually see in the browser's window.
      The

      See how the extra white spaces, tabs and line-breaks are ignored by the browser.

      6 Section and the Lists and Hyperlinks

      Lists and Hyperlinks

      There are two types of lists in HTML:

      1. Ordered List.
      2. Unordered List.

      This is a nested unordered list of links:

      • Online Validator:
        • W3C Online HTML Validator @ //validator.w3.org/.
        • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
      • Specifications:
        • HTML5 @ //www.w3.org/TR/html5/.
        • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
      96 container element encloses the title for the page. You should use a meaningful title because:
      • The title shows up at the title-bar of the browser window.
      • The title shows up in bookmarks and history lists (the URL is stored if there is no title).
      • Titles are used by search engines to index your page.

      The Lists and Hyperlinks

      Lists and Hyperlinks

      There are two types of lists in HTML:

      1. Ordered List.
      2. Unordered List.

      This is a nested unordered list of links:

      • Online Validator:
        • W3C Online HTML Validator @ //validator.w3.org/.
        • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
      • Specifications:
        • HTML5 @ //www.w3.org/TR/html5/.
        • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
      97 Lists and Hyperlinks

      Lists and Hyperlinks

      There are two types of lists in HTML:

      1. Ordered List.
      2. Unordered List.

      This is a nested unordered list of links:

      • Online Validator:
        • W3C Online HTML Validator @ //validator.w3.org/.
        • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
      • Specifications:
        • HTML5 @ //www.w3.org/TR/html5/.
        • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
      98

      The is the same as:

      Lists and Hyperlinks

      Lists and Hyperlinks

      There are two types of lists in HTML:

      1. Ordered List.
      2. Unordered List.

      This is a nested unordered list of links:

      • Online Validator:
        • W3C Online HTML Validator @ //validator.w3.org/.
        • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
      • Specifications:
        • HTML5 @ //www.w3.org/TR/html5/.
        • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
      2

      The " Lists and Hyperlinks

      Lists and Hyperlinks

      There are two types of lists in HTML:

      1. Ordered List.
      2. Unordered List.

      This is a nested unordered list of links:

      • Online Validator:
        • W3C Online HTML Validator @ //validator.w3.org/.
        • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
      • Specifications:
        • HTML5 @ //www.w3.org/TR/html5/.
        • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
      99" is needed to prevent the page from scrolling to the top following Table and Images

      Table and Images

      Logo of Languages S/No Language Logo
      1. HTML5 //validator.w3.org/.
    12. W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
    13. Specifications:
      • HTML5 @ //www.w3.org/TR/html5/.
      • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
    14. 3

      Example:

      Lists and Hyperlinks

      Lists and Hyperlinks

      There are two types of lists in HTML:

      1. Ordered List.
      2. Unordered List.

      This is a nested unordered list of links:

      • Online Validator:
        • W3C Online HTML Validator @ //validator.w3.org/.
        • W3C Online CSS Validator @ //jigsaw.w3.org/css-validator/.
      • Specifications:
        • HTML5 @ //www.w3.org/TR/html5/.
        • CSS3 Selectors @ //www.w3.org/TR/css3-selectors/.
      4

      Attributes: