HTML Tutorials - Element and Tags

Element and Tags

HTML Tutorials: Elements and Tags

In html elements consist of three basic parts (1) Opening Tag, (2) Element Content, (3) Closing Tag.

For Example:

<TITLE>

 My First Web Page

</TITLE>

Elements are the bits that make up web pages, where tags are mostly use to set the beginning and the end of an element.  When you view a web page on the internet what you see is the elements, when you view the source code you see the markup language (tags) that allow you to view the elements in a certain way.

What is a Tag in HTML?

HTML includes a series of text "tags" that describe how a Web page is formatted. Each tag appears inside brackets (<>). For example, the <strong> tag is used to create bold text. HTML written like this: This is how to create <strong>bold</strong> text. 

All tags have the same format: they begin with a less-than sign "<" and end with a greater-than sign ">".

The most important thing to remember is that in nearly all cases if you open a tag you must close the tag.

Example: <strong> </strong> <b> </b> <i> </i>

The only difference between an opening tag and a closing tag is the forward slash "/"
All web pages require four critical elements: the html, head, title, and body elements.

 

The <html>Element</html>

 

The <html> element begins and ends each and every web page, all your text and pictures should be inserted between the <html> and </html> tags.

Note: As per our previous lesson an introduction to html , you should open notepad and copy the example code into it, then save the file with a .htm or .html extension i.e. index.htm.

Example Code:

	    

<html> </html>

 

The <head> Element</head>

 

The <head> Element
The next thing your document needs is a "head" element, which provides information about your document such as title, description, keywords.  Browsers don’t usually display this information.  However if you want your website to be successful then these tags are very important for Search Engine Optimization which we will cover in future lessons.

Example Code:

<html>
<head>  </head>
<html>

 

The <title>Element</title>

 

The <title> Element

As we discussed earlier the title is enclosed in the head element.  The title element describes the content of the page, for example the title of this page would be “Introduction to Tags and Element in Html”, the title displayed at the top of a viewer's browser.

Example Code:

<html>
<head>
<title>Introduction to Tags and Element in Html /title>
 </head>
<html>

 

The <body>Element</body>

 

The <body> Element

The HTML body is the main part of the web page.  The <body> element is where all content is placed (text, video, images) and much more.  Any thing we type inside the body tag will be displayed in the browser page.

Example Code:

<html>
<head>
<title>Introduction to Tags and Element in Html /title>
 </head>
</title>
</head>
<body>
This is my first page </body>
</html>

 

That’s it on the basics of elements and tags.


C++ Functions Tutorial