Welcome to the comprehensive HTML Tutorial at CodeYourCraft! In this lesson, we'll dive into the world of HTML, explore its various elements, and learn how to use them to create stunning web pages. Let's get started! 🎯
HTML (HyperText Markup Language) is the backbone of the web. It's used to structure and format content on the web. HTML documents are made up of elements, which are defined by tags. Each tag has an opening and a closing point, enclosing the content within. 💡 Pro Tip: Tags are case-insensitive.
<html> and <head>, <body>The <html> tag wraps the entire HTML document, the <head> tag contains meta-information like title and links to external resources, and the <body> tag contains the visible content.
<html>
<head>
<title>My First Web Page</title>
</head>
<body>
<h1>Welcome to My First Web Page!</h1>
</body>
</html><h1> to <h6>: HeadersHeaders are used to organize content hierarchically. The <h1> tag represents the main heading, while <h2> to <h6> are subheadings.
<h1>Main Heading</h1>
<h2>Sub Heading 1</h2>
<h3>Sub Heading 2</h3>
<h4>Sub Heading 3</h4>
<h5>Sub Heading 4</h5>
<h6>Sub Heading 5</h6><p>: ParagraphThe <p> tag is used to define a paragraph.
<p>This is a paragraph.</p><a>: LinkThe <a> tag is used to create hyperlinks.
<a href="https://www.codeyourcraft.com">Visit CodeYourCraft</a><img>: ImageThe <img> tag is used to embed images in an HTML document.
<img src="path/to/image.jpg" alt="Description of the image"><video> and <audio>: Video and AudioThe <video> and <audio> tags are used to embed videos and audios, respectively.
<!-- Video -->
<video src="path/to/video.mp4" controls></video>
<!-- Audio -->
<audio src="path/to/audio.mp3" controls></audio>What tag defines the visible content in an HTML document?
<form>: FormsThe <form> tag is used to create interactive forms for users to submit data.
<form action="/submit_form">
<label for="name">Name:</label>
<input type="text" id="name" name="name">
<label for="email">Email:</label>
<input type="email" id="email" name="email">
<input type="submit" value="Submit">
</form><table>: TableThe <table> tag is used to create tables for structured data.
<table>
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
<tr>
<td>Data 1</td>
<td>Data 2</td>
</tr>
</table><ul> and <ol>: Unordered and Ordered ListsThe <ul> tag is used to create unordered lists (bullet points), and the <ol> tag is used to create ordered lists (numbered list).
<!-- Unordered List -->
<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
<!-- Ordered List -->
<ol>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ol>What tag is used to create a table in HTML?
That's it for our HTML Tutorial! Now you have a solid understanding of HTML's basic and advanced elements. Happy coding! 📝 Note: Don't forget to practice and experiment with these elements to truly master HTML. ✅