What Are Default Tags?

What Are Default Tags? thumbnail
A few simple tags will get your Web page working.

To a beginner, HTML tags and code can be confusing. The good news is that most tags aren't required for a valid Web page. While the use of a number of additional tags will ensure that your pages display consistently, a Web browser will understand and parse your Web page with just these default tags.

  1. HTML Tag

    • The tag that opens most Web page code is the <html> tag. While it appears to simply tell the browser that what follows is an HTML page, the <html> tag is important because it can tell the browser the exact version of HTML, or its frequently used sibling XHTML, used to code the page. This tag is optional in HTML 4.01 but mandatory in XHTML. When using the <html> tag, you must include a closing </html> tag at the very end of the page.

    Head Tag

    • The <head> tag is also not required in HTML 4.01 but mandatory in XHTML. This tag normally follows the <html> tag, and indicates the area of your Web page containing the elements that describe the page, including title, style sheet locations, meta keywords and description, and any JavaScript you want to load before the page begins to render. Below this information, a closing </head> tag should appear before the body of the document.

    Title Tag

    • The only tag required in HTML 4.01 is the <title> tag, which begins the title of your document and is necessary so that Web browsers can insert a title at the top of the page window. Search engines also use the title as link text when your page appears within search results. The World Wide Web consortium, the group that determines HTML standards, recommends keeping the page title under 64 characters. The end of the title is indicated by a closing </title> tag.

    Body Tag

    • Another element required in XHTML but not HTML is the <body> tag, which appears after the closing </head> tag and signifies the content to be displayed in the browser window. When you use the <body> tag, your visible content should be placed between it and the closing </body> tag. Some elements, such as a page-tracking code, can be added below the page body if you want them to load after the page is displayed and they aren't visible on the page itself.

    Best Practices

    • Default tags are a mere skeleton of an HTML page; other tags ensure your page looks good and renders as expected in all browsers. For example, <meta> tags can contain vital information for search engines, while styling tags such as <p>, <strong> or <div> define a page's design. Your browser's "View Source" function allows you to see the tags used by Web pages you like.

Related Searches:

References

Resources

  • Photo Credit Stockbyte/Stockbyte/Getty Images

Comments

Related Ads

Featured