HTML EXAMPLE
Here's a simple HTML example that demonstrates the basic structure of an HTML page.
<!DOCTYPE html> <html> <head> <title>My First HTML Page</title> </head> <body> <h1>Welcome to HTML</h1> <p>This is my first HTML web page.</p> <h2>My Favorite Fruits</h2> <ul> <li>Apple</li> <li>Mango</li> <li>Banana</li> </ul> <a href="https://www.example.com">Visit Example Website</a> </body> </html>
Output
The page will display:
- A main heading: Welcome to HTML
- A paragraph: This is my first HTML web page.
-
A bulleted list of favorite fruits:
- Apple
- Mango
- Banana
- A clickable link to Example Website
Basic HTML Structure
-
<!DOCTYPE html>– Declares the document as HTML5. -
<html>– The root element of the page. -
<head>– Contains metadata, such as the page title. -
<title>– Sets the title shown in the browser tab. -
<body>– Contains the visible content of the web page. -
<h1>– A top-level heading. -
<p>– A paragraph. -
<ul>– An unordered (bulleted) list. -
<li>– A list item. -
<a>– A hyperlink to another page or website.
No comments