All HTML documents must start with a document type declaration: <!DOCTYPE html>
he HTML document itself begins with <html> and ends with </html>
The visible part of the HTML document is between <body> and </body>
Example:
|
1 2 3 4 5 6 7 8 9 |
<!DOCTYPE html> <html> <body> <h1>My First Heading</h1> <p>My first paragraph.</p> </body> </html> |
HTML Attributes
- All HTML elements can have attributes
- Attributes provide additional information about elements
- Attributes are always specified in the start tag
- Attributes usually come in name/value pairs like: name=”value”
Example: The href Attribute
The <a> tag defines a hyperlink. The href attribute specifies the URL of the page the link goes to:
|
1 |
<a href="https://www.w3schools.com">Visit W3Schools</a> |