HTML and CSS Reference
In-Depth Information
Now that you've got the general idea, the next section will go into more
detail about common elements for marking up text content.
Elements for text
This section looks at HTML elements for marking up text—which, for
many web pages, is the majority of the content. Nearly every element
can contain text, but several are specifically dedicated to the task. The
most common of these is the paragraph element, <p></p> , of which
you've already seen several examples, but there are many others for
headings, unordered lists, ordered lists, line breaks, horizontal rules,
and more.
Headings and paragraphs
Paragraphs and headings work in concert to create the bulk of the text
content of a document and its implicit structure. HTML has six heading
elements, which are numbered 1 through 6: <h1> , <h2> , <h3> , <h4> , <h5> ,
and <h6> . The most significant is <h1> , which is usually the document
title; the sections should begin with <h2> elements and the subsections
with <h3> , and so on:
<html>
<head>
<title>
Headings and
implicit structure
</title>
</head>
<body>
<h1>The main heading</h1>
<p>Main introduction</p>
<h2>First section</h2>
<p>Section introduction</p>
<h3>Subsection heading 1.1</h3>
<p>Subsection 1.1</p>
<h2>Second section</h2>
<p>Section introduction</p>
<h3>Subsection heading 2.1</h3>
<p>Subsection 2.1</p>
<h4>Sub-subsection</h4>
Search WWH ::




Custom Search