An element consists of three basic parts: an opening tag, the element's content, and finally, a closing tag.
<p> - opening paragraph tag
Element Content - paragraph content
</p> - closing tag
Every webpage contains four basic elements. The html, head, title, and body elements.
The <html> element
<html> begins and ends each and every web page. Its sole purpose is to encapsulate all the HTML code. Remember to close your HTML documents with the corresponding </html> tag at the bottom of the document.
If you haven't already, open up Notepad or Crimson Editor and have a new, blank document ready to go. Copy the following HTML code into your text editor.
HTML Code:
<html>
</html>
Now save your file by Selecting Menu and then Save. Click on the "Save as Type" drop down box and select the option "All Files". When asked to name your file, name it "index.html", without the quotes. Double check that you did everything correctly and then press save. Now open your file in a new web browser so that you refresh your page and see your changes.
The <head> element
The <head> element is "next" as they say. As long as it falls somewhere between your <html> tag and your web page content, you're golden. The head functions "behind the scenes." Tags placed within the head element are not directly displayed by browsers. We will be placing the <title> element here and will talk about the other possible elements in a later lesson.
Here's a sample of the initial set up.
HTML Code:
<html>
<head>
<title>My WebPage!</title>
</head>
</html>
The <title> element
Place the <title> tag within the <head> element to title your page. The words you write between the opening and closing <title></title> tags will be displayed at the top of a viewer's browser. Here's the html code:
HTML Code:
<html>
<head>
<title>My WebPage!</title>
</head>
</html>
Save the file and open it in your browser. You should see "My WebPage!" in the uppler-left, as the window's title.
The <body> element
The <body> element is where all content is placed. Paragraphs, pictures, tables, etc.
HTML Code:
<html>
<head>
<title>My WebPage!</title>
</head>
<body>
All my content goes here!
</body>
</html>
Go ahead and view your first complete web page.
http://www.tizag.com/htmlT/elements.php