Markup Languages Consist of Sets of Directions That Tell The Browser Software (And Other
Markup Languages Consist of Sets of Directions That Tell The Browser Software (And Other
Markup Languages Consist of Sets of Directions That Tell The Browser Software (And Other
<!DOCTYPE html>
<html lang="en">
<head>
<title>Page Title Goes Here</title>
<meta charset="utf-8">
</head>
<body>
... body text and more HTML tags go here ...
</body>
</html>
The head section contains information that describes the web page document. The body section
contains the actual tags, text, images, and other objects that are displayed by the browser as a
web page.
The body element contains the body section, which begins with the <body> tag and ends
with the </body> tag.
<!DOCTYPE html>
<html lang="en">
<head>
<title>My First HTML5 Web Page</title>
<meta charset="utf-8">
</head>
<body>
Hello World
</body>
</html>
Paragraph elements are used to group sentences and sections of text together. Text that is
contained by <p> and </p> tags display as a “block” (referred to as block display) and
will appear with empty space above and below it.
Hands-On Practice 2.3
To create the web page shown in Figure 2.7, launch a text editor. Select File > Open to
edit the file located at chapter2/heading.html in the student files. Modify the page title,
and add a paragraph of text to your page below the line with the <h1> tags and above
the line with the <h2> tags. Use the following code as an example:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Paragraph Example</title>
<meta charset="utf-8">
</head>
<body>
<h1>Heading Level 1</h1>
<p>This is a sample paragraph. Heading tags can help to make your
pages more accessible and usable. It is good coding practice to use
heading tags to outline the structure of your web page content.
</p>
<h2>Heading Level 2</h2>
<h3>Heading Level 3</h3>
<h4>Heading Level 4</h4>
<h5>Heading Level 5</h5>
<h6>Heading Level 6</h6>
</body>
</html>
The purpose of an attribute is to modify the properties of an HTML element. In this case, the align
attribute modifies the element’s horizontal alignment (left, center, or right) on a web page. To
center an element on a web page, use the attribute align="center". To right-align the text within an
element, use the align="right" attribute.
The line break element causes the browser to advance to the next line before displaying the
next element or portion of text on a web page. The line break tag is not coded as a pair of
opening and closing tags. It is a stand-alone, or void element, and is coded as <br>.
<body>
<h1>Heading Level 1</h1>
<p>This is a sample paragraph. <br> Heading tags can help to make your
pages more accessible and usable. It is good coding practice to use
heading tags to outline the structure of your web page content.
</p>
<h2>Heading Level 2</h2>
<h3>Heading Level 3</h3>
<h4>Heading Level 4</h4>
<h5>Heading Level 5</h5>
<h6>Heading Level 6</h6>
</body>
In addition to organizing text in paragraphs and headings, sometimes you need to add a quotation
to a web page. The blockquote element is used to display a block of quoted text in a special
way—indented from both the left and right margins. A block of indented text begins with a
<blockquote> tag and ends with a </blockquote> tag.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Blockquote Example</title>
<meta charset="utf-8">
</head>
<body>
<h1>The Power of the Web</h1>
<p>According to Tim Berners-Lee, the inventor of the World Wide Web,
at http://www.w3.org/WAI/:</p>
<blockquote>
The power of the Web is in its universality. Access by everyone
regardless of disability is an essential aspect.
</blockquote>
</body>
</html>
<blockquote>
The power of the Web is in its universality.
<em>Access by everyone</em>
regardless of disability is an essential aspect.
</blockquote>
Ordered lists begin with an <ol> tag and end with an </ol> tag. Each list item begins
with an <li> tag and ends with an </li> tag.
<h1>My Favorite Colors</h1>
<ol>
<li>Blue</li>
<li>Teal</li>
<li>Red</li>
</ol>
<ol type="A">.
Hands-On Practice
<!DOCTYPE html>
<html lang="en">
<head>
<title>Heading and List</title>
<meta charset="utf-8">
</head>
<body>
<h1>My Favorite Colors</h1>
<ol>
<li>Blue</li>
<li>Teal</li>
<li>Red</li>
</ol>
</body>
</html>
An unordered list
<!DOCTYPE html>
<html lang="en">
<head>
<title>Heading and List</title>
<meta charset="utf-8">
</head>
<body>
<h1>My Favorite Colors</h1>
<ul>
<li>Blue</li>
<li>Teal</li>
<li>Red</li>
</ul>
</body>
</html>
description list
A description list is useful for organizing terms and their descriptions. The terms stand out, and their
descriptions can be as long as needed to convey your message. Each term begins on its own line at the
margin.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Description List</title>
<meta charset="utf-8">
</head>
<body>
<h1>Sample Description List</h1>
<dl>
<dt>TCP</dt>
<dd>Transmission Control Protocol is a method (protocol) used
along with the Internet Protocol (IP) to send data in the form of
message units, called packets, between computers over the Internet.</dd>
<dt>IP</dt>
<dd>Internet Protocol is the method or protocol by which data
is sent from one computer to another on the Internet. Each computer on
the Internet is uniquely identified by an IP address.</dd>
<dt>FTP</dt>
<dd>File Transfer Protocol is a protocol used to exchange
files between computers on the Internet.</dd>
<dt>HTTP</dt>
<dd>Hypertext Transfer Protocol is the protocol used for
exchanging text, graphic images, sound, video, and other multimedia
files on the Web.</dd>
</dl>
</body>
</html>