HTML Elements
Virtual Position Forum :: Members Lounge :: Sciences & Knowledge :: Programing and Design :: HTML & CSS
HTML Elements
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- Monstars
- Posts : 26
Join date : 2011-05-29
» HTML course for Pakistani students
» MQM, other elements involved in May 12 tragedy, Sattar told US
» div tag is used in html
» HTML Introduction
Virtual Position Forum :: Members Lounge :: Sciences & Knowledge :: Programing and Design :: HTML & CSS
|
|
Sat May 04, 2024 11:49 am by ali001
» house disrepair claims
Thu May 02, 2024 4:29 pm by Ibad Khan Buledi
» Bounce n Bang: Physics puzzler
Thu May 02, 2024 11:39 am by ali001
» AIChatSY - AIChatbot Assistant
Wed May 01, 2024 10:48 am by ali001
» Storybook Magic App
Tue Apr 30, 2024 7:06 pm by ali001
» Flower Book Match3 Puzzle Game
Tue Apr 30, 2024 12:17 pm by ali001
» Avian Influenza Symptom in Chickens "Bird Flu H5N1 Virus" Vet learning materials, Poultry Farming
Sat Apr 27, 2024 9:57 am by Ibad Khan Buledi
» Aloha Planner - Note-Taker
Thu Apr 11, 2024 4:52 pm by ali001
» Streaming Guide Film TV Series
Tue Apr 09, 2024 9:39 pm by ali001