structure with cross shaped glass

HTML Basic Structure

Overview

In this lesson you will learn about the doctype declaration as well as three of the main elements for creating and organizing your code; html, head, and body. Take a look at the code below and take notice of the elements mentioned.

<!DOCTYPE html>
<html>
    <head>
        <title>Page Title Goes Here</title>
    </head>
    <body>
        <h1>Page Header</h1>
        <p>Paragraph Text</p>
    </body>
</html>

Doctype Declaration

The doctype declaration is placed at the top of every HTML page. This is not an html element or a tag. It is simply information provided to the web browser regarding the version or standard of HTML to expect. The most recent version, HTML5, uses the simple declaration <!DOCTYPE html>.

HTML Tags

The opening <html> tag and the closing <\html> tag form a wrapper for all of your HTML content. All other HTML elements are placed within these tags.

Head Tags

Items found between the open and closing head tags are not visible on the page. These are items that provide information to the browser, such as the page title, page author, links to stylesheets, scripts, etc.

Body Tags

The body of your HTML page is where all the visible elements live. As you scroll through this page, you may notice a navbar, an image, links to other pages, sections of text, etc. All of this was created with elements placed between the opening and closing body tags.

Leave a Reply