Current location - Quotes Website - Personality signature - How to use html tags reasonably
How to use html tags reasonably
1, frame layout (using DIV tag)

DIV layout is generally used for frame layout in web pages, and DIV tags (

2. List layout (using ul li label)

When you encounter a picture list and an article title list, you will generally use the ul li list label for layout. Of course, when using these tags, you need CSS styles to achieve the layout effect. This makes it easier to loop when the program calls data.

3. Title layout (using labels h 1, h2, h3 and h4)

When encountering independent column headings and text labels, h 1, h2, h3 and h4 heading labels are usually used to make the layout content have a sense of hierarchy. At the same time, considering SEO, the proper use of these title tags is conducive to optimizing the ranking.

4. Content-independent styles (using span)

In a paragraph of text, there are several words that need to be set with separate color values. At this time, you can add span tags to these words and set the style of class or direct CSS separately to achieve the effect. Generally speaking, span is rarely used in layout frameworks.

5. Functional layout (img, B, strong, U, S and other labels)

Use Img tags when encountering attractive pictures in web pages; When the text is bold, you can use a B tag or a strong tag, when the text is underlined, you can use a U tag, when the text is crossed (crossed out), you can use an S tag and so on. Sometimes CSS is not necessarily used to realize the layout of these functions, so it is better to choose these HTML tags appropriately from the perspective of SEO.

6. Paragraph (P tag)

Generally, paragraphs in an article are marked with p, that is, at the beginning of each paragraph,

7. Manually force line break layout (br label)

Use the br tag when the text needs to wrap, that is, "

8. Form Type (Form Tab)

In HTML layout, learning DIV CSS does not mean giving up the table tag. Sometimes, you still need table tags, such as table layout or table tr td tag layout. At this point, it is better to use table layout than div tag.

9. Form layout (form, input, etc.). )

Form labels will be used when encountering form layout, such as registration, login and filling in the place where data is submitted.

Other labels are waiting for you to find and use. In DIVCSS5 training, students will also be taught what tags to choose under what circumstances. After getting familiar with the practice, they will naturally know how to choose HTML tags to lay out web pages.