HTML Text Tag Group

The Text Tag Group is a group of tags that are used to create well-formatted text documents. Text tags include <h1>-<h6>, <p>, <br>, <span>, <b>, <sup>, and others.

HTML Reference

Creating Text Documents

Originally, HTML was designed as a text formatting language for scientific documents.

This allowed formatted text documents to be easily shared electronically.

With this legacy, HTML has a rich assortment of tags that help with text formatting.


Text Tags

Here is a list of text tags that are available to format text documents.
Together, these tags allow you to create comprehensive HTML text documents.

Element Description
<h1>-<h6> Defines text headings in 6 different sizes
<p> Creates a paragraph
<span> Container for one or more inline text elements
<br> Creates a line break
<sup> Specifies superscript text
<sub> Specifies subscripted text
<u> Specifies underlined text
<i> Specifies italic text
<b> Specifies bold text
<em> Marks text that needs emphasis
<strong> Indicates text that is important or with high urgency
<del> Defines deleted text
<ins> Defines inserted text
<ruby> Represents a small annotation with pronunciation of text
<kbd> Specifies keyboard input, such as, CTRL or ALT
<wbr> Specifies a preferred word-break location for long words

Tip: More recently, text formatting and styling has shifted from HTML to CSS. Rather than using <b>, <i>, <u>, <em>, or <strong>, web developers prefer CSS which gives them more control.


Example

#

A scientific document formatted with a variety of text tags.

Alcohol

Introduction

In chemistry, alcohol is an organic compound that carries at least one hydroxyl functional group (−OH) bound to a saturated carbon atom. The term alcohol originally referred to the primary alcohol ethanol (ethyl alcohol), which is used as a drug and is the main alcohol present in alcoholic beverages.

Classes of alcohol

An important class of alcohols, of which methanol and ethanol are the simplest members, includes all compounds for which the general formula is CnH2n+1OH. Simple monoalcohols include primary (RCH2OH), secondary (R2CHOH) and tertiary (R3COH) alcohols.

<h2>Alcohol</h2>
<h3>Introduction</h3>
<p>
  In chemistry, <b>alcohol</b> is an organic compound that 
  carries at least one <i>hydroxyl functional group</i> 
  (−OH) bound to a saturated carbon atom. 
  The term alcohol originally referred to the primary 
  alcohol ethanol (<i>ethyl alcohol</i>), which is used as 
  a drug and is the main alcohol present in alcoholic beverages. 
</p>
<h3>Classes of alcohol</h3>
<p>
  An important class of alcohols, of which <b>methanol</b> 
  and <b>ethanol</b> are the simplest members, includes 
  all compounds for which the general formula is 
  C<sub>n</sub>H2<sub>n+1</sub>OH. Simple monoalcohols 
  include <u>primary</u> (RCH<sub>2</sub>OH), 
  <u>secondary</u> (R<sub>2</sub>CHOH) and <u>tertiary</u> 
  (R<sub>3</sub>COH) alcohols.
</p>

Code explanation

  • The <h2> and <h3> tags are headers that specify the document hierarchy.
  • The <p> tag defines a paragaph.
  • The <b>, <i>, and <u> tags define bold, italic, and underlined text respectively.
  • The <sub> tag creates subtext -- used in the chemical formulas.

Did you know?

Did you know?

The origins of HTML

HTML began life in CERN, the European Lab for Particle Physics in Geneva, Switzerland.

Physicists from all over the world had a need to share their scientific ideas and documents.

In 1989 Tim Berners-Lee invents HTML with these 18 tags:

  • <title>
  • <nextid>
  • <a>
  • <isindex>
  • <plaintext>
  • <listing>
  • <p>
  • <h1> - <h6>
  • <address>
  • <hp1> - <hp2>
  • <dl>
  • <dt>
  • <dd>
  • <ul>
  • <ol>
  • <li>
  • <dir>

In case you're interested this is the original HTML proposal.

Note: It's clear that HTML has evolved; today more than half of the original 18 tags are obsolete.


You may also like

 Back to Tag Groups


Guides