Summary of commonly used tags in HTML

table of Contents

Elements in the line

a tag

img tag

span tags

Block-level element

div tag

p tag

hn tag

ol tag

         ul tag


Elements in the line

In-line element: It means that it will not wrap automatically and is dissatisfied with the subtag.

a tag

Format: <a href ="URL" target="_self"> Content</a>
Function: Add a hyperlink to the content in a pair of angle brackets, and the hyperlink points to the entered URL in the form defined by the target.
Usage: In the a tag, there are two tag attribute values, href and target, which correspond to the URL and the pop-up method respectively. Among them, the target is divided into the original page pop-up _self and the new page pop-up _blank, where the default is the original page pop-up.

img tag

Format: <img src="Picture storage location" / >
Function: Add the required pictures to the webpage.
Usage: The attribute value of the src tag in the img tag needs to clearly specify the location of the picture, otherwise there will be a problem that the picture cannot be displayed. Usually, we use the title tag attribute value to describe the picture, that is, when the cursor is hovering over the picture, the description will appear; and the alt tag attribute is used to set the alternative text when the picture does not exist. The display effect of this attribute is related to the browser and browsing The device version is related.

span tags

Format: <span> text content</ span>
Usage: The span tag has no fixed format performance, and only when CSS styles are applied to it will visual changes occur.
Function: It is often used to combine inline elements in a document. It is usually used when CSS styles are used to change the style of elements in the combined document to enrich it.
 

Block-level element

Block-level elements: automatic branching, occupying the entire webpage subtags.

div tag

Format: <div>code segment</div>
Usage: segment the required piece of code with other codes to make the regional structure framework complete and orderly.
Function: Make the code structure clear and the style more beautiful. The initial design concept is shown in the figure below: divide the webpage into a head, a middle and a lower part to make it beautiful, layered and organized.

p tag

Format: <p>Code segment</p>
Usage: p tag is a paragraph tag, usually used for automatic text segmentation, each paragraph of text uses a pair of p tags. Among them, the label attributes are as follows:
align.

hn tag

Format: <hn></hn>Title Tag
Usage: The value of n is 1~6, where

Define the largest title; define the smallest title, common label attributes:
align

ol tag

format:

<ol type="" start="">
	<li></li>
	<li></li>
	<li></li>
</ol>

Usage: Insert several lines of li angle brackets between a pair of ol angle brackets, and enter the content to be displayed between the li angle brackets to complete the setting of an ordered list. It has two label attributes: type and start.
Among them, type specifies the number type of the ol subtag li, and its attribute values ​​are:

start specifies the starting point of the sequence number of the ol subtag li , the default is 1 , and it must be an integer number .

Role: to create an ordered list.

ul tag

format:

<ul type="">
	<li></li>
	<li></li>
	<li></li>
</ul>

Usage: Insert several lines of li angle brackets between a pair of ol angle brackets, and enter the content to be displayed between the li angle brackets to complete the setting of an ordered list. Since the list is an unordered list, there is no order, and there is no start tag attribute, so there is only one tag attribute: type, whose tag attribute value is:

Role: Create an unordered list.

 

 

 

 

Guess you like

Origin blog.csdn.net/m0_46383618/article/details/107472772