* Introduction to HTML
HTML (HyperText Markup Language)
I. HTML is the standard markup language used to create web pages.
II. It describes the structure of a webpage and consists of a series of elements that tell the browser how to display content.
* Basic Structure of an HTML Document
A simple HTML document has a basic structure consisting of elements that define different parts of the webpage.
Here is an example of a basic HTML document:
<!DOCTYPE html>
<html>
<head>
<title>My First HTML Page</title>
</head>
<body>
<h1>Hello, World!</h1>
<p>This is a paragraph of text.</p>
<a href="https://visualstudiocode8858.blogspot.com/">Tech Coding</a>
</body>
</html>
* OUTPUT :
Hello, World!
This is a paragraph of text.
This is a link* Explanation of the Elements
<!DOCTYPE html>
: This declaration defines the document type and version of HTML. It helps browsers to render the page correctly.<html>
: This element is the root of an HTML document. It contains all other elements.<head>
: This section contains meta-information about the document, such as its title and links to scripts and stylesheets.<title>
: This element defines the title of the document, which appears in the browser's title bar or tab.<body>
: This section contains the content of the document that is displayed in the browser.<h1>
: This is a heading element.<h1>
is the highest level heading, and<h6>
is the lowest.<p>
: This element defines a paragraph.<a>
: This element defines a hyperlink, which links to another document or resource. Thehref
attribute specifies the URL of the link.
* Common HTML Elements
- Headings:
<h1>
to<h6>
for different levels of headings. - Paragraphs:
<p>
for blocks of text. - Links:
<a>
for hyperlinks. - Images:
<img>
for embedding images. - Lists:
<ul>
for unordered lists,<ol>
for ordered lists, and<li>
for list items. - Tables:
<table>
,<tr>
,<th>
, and<td>
for creating tables. - Forms:
<form>
,<input>
,<textarea>
,<button>
, and other form elements.
* Example of a More Detailed HTML Document - <!DOCTYPE html>
- <html>
- <head>
- <title>My First HTML Page</title>
- <meta charset="UTF-8">
- <meta name="description" content="A brief introduction to HTML">
- <meta name="keywords" content="HTML, web development, beginner">
- <meta name="author" content="Your Name">
- <link rel="stylesheet" type="text/css" href="styles.css">
- </head>
- <body>
- <header>
- <h1>Welcome to Tech Coding</h1>
- <nav>
- <ul>
- <li><a href="#home">Home</a></li>
- <li><a href="#about">About</a></li>
- <li><a href="#contact">Contact</a></li>
- </ul>
- </nav>
- </header>
- <main>
- <section id="home">
- <h2>Home</h2>
- <p>This is the home section.</p>
- </section>
- <section id="about">
- <h2>About</h2>
- <p>This is the about section.</p>
- </section>
- <section id="contact">
- <h2>Contact</h2>
- <p>This is the contact section.</p>
- </section>
- </main>
- <footer>
- <p>© 2024 Your Name. All rights reserved.</p>
- </footer>
- </body>
- </html>
- <!DOCTYPE html>
- <html>
- <head>
- <title>My First HTML Page</title>
- <meta charset="UTF-8">
- <meta name="description" content="A brief introduction to HTML">
- <meta name="keywords" content="HTML, web development, beginner">
- <meta name="author" content="Your Name">
- <link rel="stylesheet" type="text/css" href="styles.css">
- </head>
- <body>
- <header>
- <h1>Welcome to Tech Coding</h1>
- <nav>
- <ul>
- <li><a href="#home">Home</a></li>
- <li><a href="#about">About</a></li>
- <li><a href="#contact">Contact</a></li>
- </ul>
- </nav>
- </header>
- <main>
- <section id="home">
- <h2>Home</h2>
- <p>This is the home section.</p>
- </section>
- <section id="about">
- <h2>About</h2>
- <p>This is the about section.</p>
- </section>
- <section id="contact">
- <h2>Contact</h2>
- <p>This is the contact section.</p>
- </section>
- </main>
- <footer>
- <p>© 2024 Your Name. All rights reserved.</p>
- </footer>
- </body>
- </html>
* OUTPUT
Welcome to Tech Coding
Home
This is the home section.
About
This is the about section.
Contact
This is the contact section.
© 2024 Your Name. All rights reserved.
This document includes additional elements such as
header
, nav
, main
, section
, and footer
to create a more structured and semantic webpage.View for More ...