Virtual Position Forum
Please register to watch content in detail
Thanks
Admin virtual position


Join the forum, it's quick and easy

Virtual Position Forum
Please register to watch content in detail
Thanks
Admin virtual position
Virtual Position Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

HTML Elements

View previous topic View next topic Go down

GMT + 3 Hours HTML Elements

Post by WikiLeaks Sun May 29, 2011 1:26 pm

HTML Element Syntax

A
n HTML element starts with a start tag / opening tag
An HTML element ends with an end tag / closing tag
The element content is everything between the start and the end tag
Some HTML elements have empty content
Empty elements are closed in the start tag
Most HTML elements can have attributes

HTML Document Example


Code:
<html>

<body>
<p>This is a paragraph.</p>
</body>

</html>



HTML Example Explained

The

element:

This is my first paragraph.


The

element defines a paragraph in the HTML document.
The element has a start tag

and an end tag

.
The element content is: This is my first paragraph.

The element:


Code:
<body>
<p>This is my first paragraph.</p>
</body>

The element defines the body of the HTML document.
The element has a start tag and an end tag .
The element content is another HTML element (a p element).

The element:


Code:
<html>

<body>
<p>This is my first paragraph.</p>
</body>

</html>


The element defines the whole HTML document.
The element has a start tag and an end tag .
The element content is another HTML element (the body element).

Don't Forget the End Tag

Some HTML elements might display correctly even if you forget the end tag:

This is a paragraph

This is a paragraph
The example above works in most browsers, because the closing tag is considered optional.

Never rely on this. Many HTML elements will produce unexpected results and/or errors if you forget the end tag .

Empty HTML Elements

HTML elements with no content are called empty elements.


is an empty element without a closing tag (the
tag use for line break).

WikiLeaks
WikiLeaks
Monstars
Monstars

Posts : 26
Join date : 2011-05-29

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

Permissions in this forum:
You cannot reply to topics in this forum