Chapter 2. Structuring The Web Content with HTML
Now that you have your hosting company and your very first web page, it’s time to take a closer look at exactly what it is you uploaded.
The page you uploaded in Chapter 1 consisted of the markup shown in Example 2-1.
Example 2-1. Your first web page
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"utf-8"
>
<title>
Blip de Bit</title>
<meta
name=
"description"
content=
"Blip de Bit!"
>
</head>
<body>
<h1>
Hello, World!</h1>
<p>
How do you like my new site, eh?</p>
</body>
</html>
In this chapter, I’m going to cover the very basic HTML elements in the page, as well as some others you’ll see used universally throughout the Web.
Basic Page Structure
Hypertext Markup Language, or HTML, is the language of the Web. It consists of elements—text components enclosed in angle brackets (<, >), each of which has its own meaning and default appearance. Browsers have the ability to read the markup elements, such as <head> or <p> and know exactly what to do with the contents. Some of the elements provide information; others provide structuring for the page contents.
In Example 2-1, the basic page structure is defined by four overall elements:
- The doctype declaration
- The html element
- The head element
- The body element
The doctype
The doctype element (<!DOCTYPE html>) tells the browser what type of markup is being used in the page. In Example 2-1, the markup is HTML5, the fifth version of the most common type of HTML. Other common ...
Get Getting Started with the Web now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.