Reading Time: ( Word Count: )

Creating the HTML, Head, and Body Sections

Description: This post may contain affiliate links; this means that if you click on a link and buy something we recommend, we can get a commission. Read more about the affiliate disclosure here.


All of your HTML coding—except the DOCTYPE tag—should be placed within the two-sided <HTML> tag. Recall from the Introduction that when a tag is two-sided, it requires a relating shutting label or tag that is indistinguishable from the initial tag however contains a cut or slash: </html>. The tags <HTML>and </html> serve as a “wrapper” around all the other tags in the document.

Also, your record ought to have two segments: a Head and a Body. The Head section is defined by the two-sided <head> tag. The Head section contains the page title, which is the text that will appear in the title bar of the Web browser and on the Microsoft Windows taskbar button. It also includes information about the document that is not displayed, such as its <meta> tags. You can also include lines of code that run scripts, like Javascript.

The Body section is defined by the two-sided tag <body>, and it contains all the information that appears in the Web browser when you view the page.

Note: The <html>, <head>, and <body> tags are all optional in HTML—but you should still use them because it’s a good design practice. They are required in XHTML. In addition, in XHTML you must add an argument to the <HTML> tag that declares its XML namespace, a reference to the fact that XHTML is created within XML. Here’s how the opening <HTML> tag should look in an XHTML document:

<html xlmns=”http://www.w3.org/1999/xhtml”>.

In this post, you will create an HTML5 template file that you can reuse later for your own work.

SET UP

Start Microsoft Notepad Before Starting

  • In Notepad, open the Format menu. Word Wrap should have a check mark next to it. If it does not, click it to enable the Word Wrap feature.

Tip Using Word Wrap makes it easier to see long lines of HTML coding without scrolling.

  • In the Notepad window, type the following:

<DOCTYPE HTML>

  • Press Enter, and then type:

<html>

<head>

  • Press Enter two or three times to add some blank lines, and then type:

</head>

<body>

  • Press Enter two or three times to add some blank lines, and then type:

</body>

</html>

  • Save the file as HTML5.htm on your Windows desktop (or to any other location that is convenient for you).

CLEAN UP

Close the notepad window.

You now have a template for creating any HTML documents you like. You can reopen this layout document and spare it under various names, which will spare time re-making these basic tags.

Tip If you need to maintain a strategic distance from incidentally altering the format, later on, make it read-as it was. To do so, in Windows Explorer, right-click the file, and then select Properties from the contextual menu. In the Properties dialog box, select the Read-Only checkbox. When you try to save changes to a read-just record, a blunder message shows up and a Save As exchange box prompts you to save a copy of it with a new name.

About the Author

Shayan Ahmed

Shayan is a passionate Blogger who has written technology-intensive articles since 2018, is a WordPress enthusiast, Bachelor, and also read Computer Engineering. You can find many interesting articles and help here.

Subscribe

Advertisement



Most Recent

Join Us

Follow Us

Most Related

Submit a Comment

If you have any idea please give to us. Or leave a beautiful comment to our post.

0 Comments

Leave your suggestion

Subscribe

Join us for latest deals and updates

Share This