If you want to make a website, learning HTML is inevitable. Even if you use tools such as Dreamweaver to create websites, understanding basic HTML knowledge will make you feel more relaxed during the website creation process and help you create better websites.
In this article we will learn about the important component of HTML - element. Elements are used to structure HTML documents and tell browsers how to render web pages. Generally speaking, an element consists of a start tag, content and an end tag.
1. What is a “label”?
Tags indicate the beginning and end of an element.
All tags have the same format: start with a less than sign "<" and end with a greater than sign ">".
Generally speaking, there are two types of tags - start tag (such as <html>) and end tag (such as </html>). The only difference between them is that the last tag has an extra slash "/. You mark the content by placing it between the first and last tags.
HTML mainly consists of various elements, so learning HTML means learning to use various elements.
For example: For example, the function of the b element is to tell the browser that the text between the tags <b> and </b> should be displayed in bold. (The "b" here means "bold".)
Example 1:
<b>This sentence appears in bold. </b>
This example will appear as follows in the browser:
The function of h1, h2, h3, h4, h5 and h6 elements is to display the title (h here means "heading"). Among them, h1 is the first-level heading, with the largest font; h2 is the second-level heading, with the font slightly smaller than the first-level heading; and h6 is the sixth-level heading, which is the last level heading and has the smallest font.
Example 2:
<h1>This is the title</h1>
<h2>This is a subtitle</h2>
This example will appear as follows in the browser:
As the saying goes, there are exceptions to everything. In HTML, there are exceptions, that is, some elements do not have a trailing tag. These elements without trailing tags are called empty elements, and they have nothing to do with the specific text content, such as the following line break tag: <br />.
2. Should the letters in labels be uppercase or lowercase?
Most browsers don't mind if tags are uppercase, lowercase, or mixed case. So <HTML>, <html> or <HtMl> will display the same on the browser. However, the correct way to write the label is to use lowercase letters. So, get into the habit of writing labels in lowercase letters .
3. Where to put the label?
You should write tags in HTML documents. A website may contain multiple HTML documents. The process of surfing the Internet is actually the process of opening different HTML documents.