
Welcome to the recap of the first chapter. At the end of each chapter, we have a recap that helps you to review what you learned during the chapter in a short time.
1. HTML code structure:
Every HTML code consists of opening and closing tags with content between them.
<title> This is the page title </title>
2. HTML file structure:
Every HTML code consists of the tags mentioned below:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
</body>
</html>Inside <head> tag, we add information about the HTML file.
inside <body> tag, we add the content we want to display on our web page.
3. Some common text tags:
<h1> .. <h6> = heading
<p> = paragraph
<strong> = bold text
<em> = italic text
4. List:
There are two types of lists which are called "ordered list" and "unordered list," and inside each, we can have "list items" as shown below:
Ordered list:
<ol>
<li> First item </li>
<li> Second item </li>
</ol>Unordered list:
<ul>
<li> First item </li>
<li> Second item </li>
</ul>5. Link:
To create links, we use <a> tag, and the content coming in between will be the text showing the link.
<a> Click Here </a>
Attribute:
Attributes are additional information added inside the opening tags. For example, for <a> tag, we use "href" attribute to add the destination URL.
<a href="example .com" > Click Here </a>
6. Self-closing tag:
In HTML, some tags don't have any content, so they don't need a closing tag. That's why we call them self-closing tags, like examples mentioned below:
<br>
<hr>
7. Image:
Image is a self-closing tag, and we add the content using "src" attribute.
<img src="images/cat.png">
8. HTML comment:
Comments are notes which have no effect on the code, just a reminder or a note for developers. We use comments for three main reasons:
To organize our code
If other developers look at our code, they understand it better through comments
If we look at our code after a while, comments help us understand
Here is how we create a comment in HTML:
<!-- The comment is here -->