Posts in current category
May 02, 2021 11:06 HTML
This chapter describes examples of labels that are more commonly used in HTML.
You may not have been exposed to these instances yet, but don't worry, you'll be able to master them by reading this chapter!
HTML headings are defined by the hashtags .
the English header title, which is ubiquitous and has a wide range of applications: website structure, writing, PPT, etc.
Here are six title element tags --
element represents a different level of content in the document:
The main title (the main
the secondary subheadings (subheadings), the third-level subheadings (sub-subheadings), and the size of the
fonts decreases in turn.
You can also try to challenge the settings of an h2 title through a hands-on experiment:
HTML paragraphs are defined by the tag
paragraph and is often used to create a paragraph that, just like your writing, allows you to do a
The following example describes the hierarchy of headings and paragraphs:
<h2>第一回 宴桃园豪杰三结义 斩黄巾英雄首立功</h2>
<h2>第二回 张翼德怒鞭督邮 何国舅谋诛宦竖</h2>
What the elements involved in the above examples represent depends entirely on what the author edits, as long as the hierarchy is reasonable. When creating such structures, you only need to keep the following in mind:
<h1>for each page, which is the main title, and all other titles are below the hierarchy.
<h3>for the subheading, followed by
<h2>for the subheading, which makes no sense and can lead to strange results.
There may be a lot of spaces in the code -- this is not necessary
The following two snippets are equivalent:
<p>狗 狗 很 呆 萌。</p>
<p>狗 狗 很
Why do we use so many spaces?
The answer is for readability - if your code is well formatted, it's easy to understand your code, and it's confusing. In our HTML code, we have each nested element indented in two spaces.
The style you use to format your code depends on you (for example, how many spaces you use for each layer indentation), but remember that you should stick to a certain style.
HTML links are
label, also known as
can be used to link to an external address to implement page jump functionality, or to link to a part of the current page to implement internal
Tip: Specify the address of the link in the
(You'll learn more about attributes later in this tutorial)
element to add a picture to your
site, and use the
property to point to the specific address of a picture.
For example: slt;img src "https://www.your-image-source.com/your-image.jpg" rel"external nofollow"
is a self-closing element and does not require an end tag.
Note: The name and size of the image are provided as attributes.
In human language, in order to highlight the meaning of a sentence, we usually emphasize certain words, and we usually want to mark certain words as a focus or to indicate some degree of difference. HTML provides many semantic elements and allows us to mark the body content with the meaning of those elements, and in this section we will see the most common small number of elements.
In HTML, we can
element to mark a situation where the browser's default style is italic:
<p>我 <em>很高兴</em>你不 <em>讨厌我</em>.</p>
In HTML, we can also mark such a request with the
, which is bold by the browser default:
Note: For different font styles, we should use elements and some CSS styles.