liveBook · Manning

HTML tag

As explained in Web Design Playground

A markup delimiter that marks the start or end of an element in HTML and related markup languages.

An HTML tag is a short bit of code in angle brackets that tells a browser what to do with part of a web page. Tags can turn text into a paragraph or heading, emphasize it, create a list, insert an object, or define a link. Think of them as small labels placed in ordinary text: you add the labels, and the browser renders the page. section 1.1 section 1.23

A typical tag has three pieces: a left angle bracket (<), an element name, and a right angle bracket (>). For example, <p> uses the element name p for a paragraph, <em> uses em for emphasis, and <h1> uses h1 for a first-level heading. An element is the named HTML item; a tag is that element name together with its brackets. section 1.14

Most text tags work as a pair:

  • Start with an opening tag, such as <h1>. It tells the browser to begin applying that element. section 1.14
  • Put the affected text after it. section 1.15
  • Finish with a closing tag, such as </h1>. It repeats the element name and adds a forward slash before it. section 1.14

Making a heading

<h1>How New Words Are Created</h1> The opening <h1> starts a first-level heading, the words are the content, and </h1> ends the heading. With only a few characters, the browser gives the text heading treatment: larger and bold compared with regular page text. section 1.15

Opening and closing tags form a container. The container can hold text or even other elements, and the browser displays its contents according to the named element. Most tags need a closing tag, so remember the slash: <p> begins a paragraph and </p> ends it. section 1.14 section 1.23

<h1>How New Words Are Created</h1>    #1    #2    #3  

Use the labeled heading listing to spot the opening tag, the text it affects, and the closing tag. Then try changing a one-word paragraph such as “Combining” into a second-level heading with h2 tags. section 1.15

Tags handle structure, while CSS handles presentation. Together they let you build a page from plain text rather than a complicated visual interface: HTML identifies things such as headings, paragraphs, and links, and CSS supplies presentation rules. section 1.23 section 2.0

How Web Design Playground covers it

How deep it goes
Defines tag syntax, distinguishes elements from tags, and works through opening and closing heading tags without covering broader page structure.
Examples
Uses p, em, h1, h2, and a tags, including a labeled heading listing and linked-word markup.
What it assumes
Teaches tags from zero as simple text codes and does not assume prior programming knowledge.
What you can do after
Build it from scratch by placing opening and closing tags around text to create headings and other page elements.
How it connects
Connects HTML tags with HTML elements, browser rendering, CSS properties, headings, paragraphs, and links.

Also explained in

Compare how 4 books explain HTML tag →

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.