Home Web Front-end HTML Tutorial html How to use html tags

html How to use html tags

May 28, 2019 am 10:34 AM
html tag

html How to use html tags

How to choose the HTML tags to use? When to choose which label? How to choose HTML tags in web page layout?

When laying out, you will encounter how to choose the HTML tag layout, but it is very simple for non-novice CSSers, but it is an invisible problem for those who have just learned or just started making CSS.

Here is a brief introduction to how to select HTML tags in DIV CSS layout:

1. Frame layout (using DIV tags)

Generally use DIV for frame layout in web pages Layout, regardless of the size of the DIV box, generally use the DIV tag (

) layout.

2. List layout (using ul li tag)

When encountering picture lists and article title lists, ul li list tags are usually used for layout. Of course, setting up when using these tags requires CSS styles to achieve layout effects. This makes it easier for the program to do loop content when calling data.

3. Title layout (using h1, h2, h3, h4 tags)

When encountering independent column titles and text tags, usually use h1, h2, h3, h4 title tags. This layout gives the content a sense of hierarchy. At the same time, considering SEO, proper use of these title tags will help optimize rankings.

4. Content independent style (using span)

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

5. Functional layout (img, b, strong, u, s, etc. tags)

Use the Img tag when encountering attractive images on the web page; use the b tag when encountering bold text or strong tag, use u tag when encountering underline, use s tag when encountering text through line (strikethrough), etc. Sometimes CSS is not necessarily used to implement these functional layouts. It is better to use these HTML tags appropriately from the SEO aspect.

6. Paragraph (p tag)

Generally, the p tag is used for paragraphs in articles, that is,

is used at the beginning of each paragraph and

is used at the end, so that the article The paragraphs are clear.

7. Manually force line break layout (br tag)

If you encounter text that needs to be wrapped, use the br tag, that is, "
". It is worth noting that the br tag is a separate tag. The box tag is an independent tag. Use the br tag wherever line breaks are needed.

8. Table type (table table tag)

In HTML layout, learning DIV CSS does not mean giving up the table tag. This sometimes still requires the table tag, such as when encountering table type For layout, table tr td tag layout is still needed. At this time, using table layout is better than div tag.

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

When encountering form layout, such as registration, login, filling in data and submitting places, etc., all use form tags.

The above is the detailed content of html How to use html tags. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to extract HTML tag content using regular expressions in Go language How to extract HTML tag content using regular expressions in Go language Jul 14, 2023 pm 01:18 PM

How to use regular expressions to extract HTML tag content in Go language Introduction: Regular expression is a powerful text matching tool, and it is also widely used in Go language. In the scenario of processing HTML tags, regular expressions can help us quickly extract the required content. This article will introduce how to use regular expressions to extract the content of HTML tags in Go language, and give relevant code examples. 1. Introduce related packages First, we need to import related packages: regexp and fmt. regexp package provides

How to remove HTML tags using Python regular expressions How to remove HTML tags using Python regular expressions Jun 22, 2023 am 08:44 AM

HTML (HyperTextMarkupLanguage) is a standard language for creating Web pages. It uses tags and attributes to describe various elements on the page, such as text, images, tables, links, etc. However, when processing HTML text, it is difficult to quickly extract the text content for subsequent processing. At this time, we can use regular expressions in Python to remove HTML tags to quickly extract plain text. In Python, regular tables

How to remove HTML tags from string in PHP? How to remove HTML tags from string in PHP? Mar 23, 2024 pm 09:03 PM

PHP is a commonly used server-side scripting language that is widely used in website development and back-end application development. When developing a website or application, you often encounter situations where you need to process HTML tags in strings. This article will introduce how to use PHP to remove HTML tags from strings and provide specific code examples. Why do you need to remove HTML tags? HTML tags are often included when processing user input or text obtained from a database. Sometimes we want to remove these HTML tags when displaying text

How to escape html tags in php How to escape html tags in php Feb 24, 2021 pm 06:00 PM

In PHP, you can use the htmlentities() function to escape html, which can convert characters into HTML entities. The syntax is "htmlentities(string,flags,character-set,double_encode)". You can also use the html_entity_decode() function in PHP to de-escape html and convert HTML entities into characters.

How to remove HTML tags from given string in Java? How to remove HTML tags from given string in Java? Aug 29, 2023 pm 06:05 PM

String is a final class in Java, it is immutable, which means we cannot change the object itself, but we can change the reference of the object. HTML tags can be removed from a given string using the replaceAll() method of String class. We can remove HTML tags from a given string using regular expressions. After removing the HTML tags from the string, it returns a string as normal text. Syntax publicStringreplaceAll(Stringregex,Stringreplacement) example publicclassRemoveHTMLTagsTest{&nbs

How to use HTML tags in HTML tables? How to use HTML tags in HTML tables? Sep 08, 2023 pm 06:13 PM

We can easily add HTML tags in the table. HTML tags should be placed inside <td> tags. For example, add paragraph <p>…</p> tags or other available tags inside the <td> tag. Syntax The following is the syntax for using HTMl tags in HTML tables. <td><p>Paragraphofthecontext</p><td>Example 1 An example of using HTML tags in an HTML table is given below. <!DOCTYPEhtml><html><head&g

What is an example of a starting tag in HTML? What is an example of a starting tag in HTML? Apr 06, 2025 am 12:04 AM

AnexampleofastartingtaginHTMLis,whichbeginsaparagraph.StartingtagsareessentialinHTMLastheyinitiateelements,definetheirtypes,andarecrucialforstructuringwebpagesandconstructingtheDOM.

PHP regular expression method to verify basic HTML tags PHP regular expression method to verify basic HTML tags Jun 24, 2023 am 08:07 AM

PHP is an efficient web development language that supports regular expression functions and can quickly verify the validity of input data. In web development, HTML is a common markup language, and validating HTML tags is a very important method for web form validation. This article will introduce basic HTML tag verification methods and how to use PHP regular expressions for verification. 1. Basic structure of HTML tags HTML tags consist of element names and attributes surrounded by angle brackets. Common tags include p, a, div

See all articles