Analysis of common tags in HTML (with code)

Source: Internet
Author: User
This article gives you the content is about the common tags in the HTML analysis (with code), there is a certain reference value, the need for friends can refer to, I hope to help you.

1.1 Classification of tags

1.1.1 by main category :

1. Tags with a body: such as <font> data </font>

2. Labels without a body: such as <br/> line wrapping labels

To determine if a table needs to have a body, you can think about whether the tag needs to encapsulate the data, if you need to encapsulate the data, then the tag must have a body, if you do not need to encapsulate the data, then you do not need to take the body .

2.1.2 Classification by line :

1. If the contents of a label need to be a separate line, we call it a block label. such as:

2. If a label does not need to be a separate line, we call it an inline label. such as:<font> font tags

2.2 Text Tags :

Label Signature Label description Common Properties
H1~h6 Title label, all headings are bold , 1 is 1 level title, Word maximum, level 6 title minimum

property is in the start tag.

align: set caption Alignment

Center: Center, right: justify, left: aligned

hr Draw a horizontal line width: line length size: thickness color: colors
B Bold font, same as strong label function
I Set Font to Italic
Br

Line break

Font fonts (already obsolete in HTML5) Color: Colour size: Face: Specify the name of the font
P segments, each P tag is a paragraph with no first line indentation. There are gaps between paragraphs

If you want to indent, use it; half-width spaces can also be full-width spaces

title: After moving the mouse, display text message

2.3 tags with inline tags :

1.DIV: Block label, need to separate one row.

2.span: inline tag, do not need to be on a separate line.

Case text Material

World Wide web consortium</p> www Alliance was created in 1994

Code Demo

<! DOCTYPE html>

2.4 List Tags :

<! DOCTYPE html>

2.5 Entity Characters

Why 2.5.1 need to use the entity characters :

In an HTML page, some characters are characters that have special meanings, and if you need to display this special character on a Web page, you need to use the entity character that corresponds to that particular character. For example,:< less than > Greater than

2.5.2 Entity character List :

Note: The entity name is case sensitive!

2.5.3 commonly used entity characters :

Special characters The corresponding entity character
< &lt;
> &gt;
Space &nbsp;

&yen;

Version All &copy;
&reg;
<! DOCTYPE html>

2.6 Image Label (IMG)

the role of 2.6.1 tags :

displays the picture in the Web page .

2.6.2 commonly used properties :

Property name function
src source picture file address, note: cannot use client-local address , such as: C:/aaa.jpg
width picture width, if you specify width and height only, another parameter scales proportionally
height picture height
alt if The picture is missing, the text of the picture is displayed
title If you move the mouse over the picture, display the prompt text message
<!    DOCTYPE html>
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.