How HTML Works in a Web Browser
- Write HTML Code
- Browser Reads the Code
- Interpret the Tags
- Render the Page
XHTML (Extensible HyperText Markup Language)
- XHTML is a stricter and cleaner version of HTML.
- Introduced in 2000, based on XML rules.
Notes:
- Tags must always be properly nested.
- All tags must be closed.
- Tag names/attributes in lowercase.
- Attribute values must be in quotes.
Example:
<p>This is valid in XHTML</p>
<br />
<img src="image.jpg" alt="sample image" />
Comments in HTML (<!-- -->
)
- Comments are ignored by the browser.
- Used for documentation, explanations, or disabling code.
Syntax:
<!-- This is a single-line comment -->
<!--
This is a
multi-line comment
-->
Examples:
<p>Hello World!</p>
<!-- This paragraph displays 'Hello World!' -->
<!-- <p>This paragraph is hidden and won’t show on the page</p> -->
<!-- Header Section -->
<h1>Welcome</h1>
<!-- Footer Section -->
<p>Copyright 2025</p>
OutPut :