CHAPTER 2

Creating Your First Web Pages

In this chapter, you briefly study the anatomy of a web page before launching Visual Studio Code, configuring it, and using it to create your first web pages. You learn to add headings, text, and comments to web pages; view a page’s source code and validate HTML; and create hyperlinks between web pages.

image

Study the Anatomy of a Web Page

Tell Visual Studio Code Which Folder to Use

Create Your First Web Page

Open the Web Page in a Browser

Add Headings and Text

Nest One Element Within Another Element

Add Comments

Apply Direct Formatting

View a Page’s Source Code

Validate a Web Page

Create Another Web Page

Understanding the Essentials of Hyperlinks

Create a Hyperlink Between Your Web Pages

Interpret HTTP Status Codes

Study the Anatomy of a Web Page

In HTML, each web page has the same basic structure, no matter how simple or complex the page is.

An HTML web page starts with a DOCTYPE definition that specifies the document’s encoding type. Next comes a statement of the language used, such as lang="en" to indicate English. After that, the web page consists of a head element and a body element. The head element contains information about the document, such as the page title and the base URL for links. The body element holds the remaining content of the web page, such as headings, text, and linked media files.

Identify the Four Key Elements of ...

Get Teach Yourself VISUALLY HTML and CSS, 2nd Edition 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.