HTML Introduction & Basic Structure, HTML Tags
[Classroom Tip] This demo shows the structure of HTML documents, the anatomy of HTML elements, and common tags in action. Use each section to reinforce the concepts from the lecture.
[Tip] Open DevTools (F12) → Elements tab to see the actual HTML being parsed by the browser.
Every HTML document is a tree of nested elements. Click the tags below to learn what each part does.
Key insight: The browser reads this structure top-to-bottom and builds the DOM (Document Object Model) — an internal tree representation that CSS and JavaScript can then manipulate.
Click each tag below to see what it does and view a rendered example.
This is a paragraph. Browsers automatically add margin above and below each paragraph element.
This is a second paragraph. Notice the spacing between them — that comes from the browser's default stylesheet.
This text is normal. This text is bold and semantically important. Back to normal.
Compare: b tag (presentation only) vs strong tag (semantic importance)
The deadline is tomorrow — please submit before midnight.
Compare: i tag (presentation) vs em tag (semantic stress)
<img src="photo.jpg" alt="Description of image">
Line one.
Line two (after br tag).
Line three.
Content below a horizontal rule (<hr>)
Search result: The HTML standard was created by Tim Berners-Lee.
Small print: Terms and conditions apply.
Underlined text (avoid for non-links as it causes confusion)
Type HTML below and see the rendered output instantly. Try headings, paragraphs, and formatting tags!
[Note] The preview updates as you type. Try adding <h1>, <mark>, <br>, or <ul><li> tags!
This is correct nesting.