liveBook · Manning

HTML element

As explained in Web Design Playground

A distinct part of a document or markup tree that can be targeted for styling or structure.

An HTML element is a named piece of a web page, like a paragraph, an emphasis, or a heading. Think of it as a little instruction for the browser: “Treat this content as this kind of thing.” The element name is the short code, such as p, em, or h1; the tag is that name wrapped in angle brackets, such as <p> or <em>. section 1.14

Most elements use an opening tag and a closing tag to make a container. Put content between them, and the browser lays it out according to that element. The closing tag repeats the name but adds a forward slash. section 1.14

Make a heading

To make an article’s main heading, wrap its words in h1 tags: <h1>How New Words Are Created</h1> The opening <h1> starts a first-level heading, and </h1> tells the browser where that heading ends. Heading elements h1 through h6 can also show how page text is organized. section 1.14 section 2.20

A basic page uses elements as containers inside other elements:

  • The html element wraps the page’s HTML and CSS. section 2.2
  • The head element holds page information, including character-set, title, and style elements. section 2.2
  • The body element holds most of the page’s visible HTML tags and text. section 2.2
Listing 2.1 A Basic HTML Structure for Starting Any Web Page Project
<!DOCTYPE html>                   #1
<html lang="en">                  #2
    <head>                        #3
        <meta charset="utf-8">    #4
        <title></title>           #5
        <style></style>           #6
    </head>                       #3
    <body>                        #7
    </body>                       #7
</html>                           #2

Use this starter structure to spot matching opening and closing tags and see where the html, head, and body elements belong. section 2.2

Try it: add a short phrase between <em> and </em>, then add a heading between <h1> and </h1>. Each pair marks where one kind of content begins and ends. section 1.14

How Web Design Playground covers it

How deep it goes
Defines element-versus-tag terminology and explains paired containers, then applies them in basic page structure and headings.
Examples
Demonstrates p, em, and h1 elements, a main article heading, heading levels h1–h6, and an html-head-body starter page.
What it assumes
Starts from zero by defining angle brackets, element names, opening tags, and closing tags.
What you can do after
Build it from scratch by pairing opening and closing tags to mark headings, text, and page sections.
How it connects
Connects HTML elements with tags, headings, page structure, attributes, HTML5, CSS, and semantic page divisions.

Also explained in

Compare how 4 books explain HTML element →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Web Design Playground. The section links point to the parts of the book it draws on.