HTML Advanced
HTML Advanced
HTML (Hypertext Markup Language) is the foundation of all web pages. It structures content and defines the
relationships between elements on a webpage.
An HTML file starts with <!DOCTYPE html> to define the version. The <html> tag wraps the whole content.
The <head> tag contains meta information, title, and links to external resources. The <body> tag includes the
visible content such as text, images, and other elements.
Example structure:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
</body>
</html>
2. Comments:
Comments are added using <!-- comment here -->. They do not display on the browser and are useful for
notes or explanations within the code.
- Tags define elements and are written in angle brackets. Most have opening and closing pairs, e.g., <p></p>.
Some are self-closing like <br> or <img />.
Examples:
1|Page
<br>: Line break, moves text to the next line without creating a new paragraph
4. Div Element:
Example:
<div>
</div>
Best Practice: Use <div> and CSS for layout instead of excessive <br> tags.
2|Page