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
Yesterday at 12:21 pm by ali001
» Hemangiom'App
Tue Nov 05, 2024 11:25 am by ali001
» MindfulMe - Mental Health App
Mon Nov 04, 2024 10:50 am by ali001
» Learn Candlestick Patterns
Tue Oct 15, 2024 5:51 am by ali001
» Woh Pagal Si Episode 52 to 62 - Top Pakistani Drama
Sat Sep 21, 2024 6:26 pm by Mir Emmad Ali Khan Domki
» Nearu - share your socials
Sat Sep 21, 2024 1:12 pm by ali001
» Nightclub Tycoon: Idle Empire
Thu Sep 19, 2024 9:16 pm by ali001
» Carnivore - Meat Diet Recipes
Wed Sep 18, 2024 2:37 pm by ali001
» Eid Milad un Nabi Mubarak 2024 (Rabiʻ I 14, 1446 AH)
Tue Sep 17, 2024 3:44 pm by Mir Emmad Ali Khan Domki