Home Web Front-end Front-end Q&A What is semantic html

What is semantic html

May 06, 2021 am 11:52 AM
html

Semantic HTML refers to: according to the structuring of the content (content semantics), selecting appropriate tags (code semantics) makes it easier for developers to read and write more elegant code while allowing the browser to The crawlers and machines parse well. Semanticization is beneficial to SEO and helps search engine crawlers better understand web pages, obtain more effective information, and increase weight.

What is semantic html

The operating environment of this tutorial: Windows 7 system, HTML5 version, Dell G3 computer.

1. What is HTML semantics?

Based on the structure of the content (content semantics), select appropriate tags (code semantics) to facilitate developers to read and write more elegant code while allowing browser crawlers and machines to parse it well.

2. Why semantics?

  • In order for the page to present a good content structure and code structure without CSS: in order to look good when running naked;
  • User experience: such as title , alt is used to explain nouns or explain picture information, and the flexible use of label tags;
  • is beneficial to SEO: establishing good communication with search engines, helping crawlers to crawl more effective information: crawlers rely on labels to Determine the context and weight of each keyword;
  • Convenient for other devices to parse (such as screen readers, blind readers, mobile devices) to render web pages in a meaningful way;
  • Convenient for team development and Maintenance, semantics and more readability are important trends in the next step for web pages. Teams that follow W3C standards all follow this standard, which can reduce differentiation.

3. What should you pay attention to when writing HTML code?

  • Use the unsemantic tags p and span as little as possible;
  • When the semantics are not obvious, you can use p or p, try to use p, because p has upper and lower spacing by default, which is beneficial for compatibility with special terminals;
  • Do not use pure style tags, such as: b, font, u, etc., use css settings instead.
  • Text that needs to be emphasized can be included in the strong or em tag (browser default style, if you can specify it with CSS, you don’t need them). The default style of strong is bold (do not use b), and em is italic. (No i);
  • When using a table, use caption for the title, thead for the table header, tbody for the main part, and tfoot for the tail. The table header should be distinguished from the general cells. Use th for the table header and td for the cells;
  • The form fields should be wrapped with fieldset tags, and the legend tag should be used to describe the purpose of the form;
  • Each The description text corresponding to each input label needs to use the label label, and by setting the id attribute for the input and setting for=someld in the label label, the description text is associated with the corresponding input.

Recommended tutorial: "html video tutorial"

The above is the detailed content of What is semantic html. 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
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
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)

Table Border in HTML Table Border in HTML Sep 04, 2024 pm 04:49 PM

Guide to Table Border in HTML. Here we discuss multiple ways for defining table-border with examples of the Table Border in HTML.

HTML margin-left HTML margin-left Sep 04, 2024 pm 04:48 PM

Guide to HTML margin-left. Here we discuss a brief overview on HTML margin-left and its Examples along with its Code Implementation.

Nested Table in HTML Nested Table in HTML Sep 04, 2024 pm 04:49 PM

This is a guide to Nested Table in HTML. Here we discuss how to create a table within the table along with the respective examples.

HTML Table Layout HTML Table Layout Sep 04, 2024 pm 04:54 PM

Guide to HTML Table Layout. Here we discuss the Values of HTML Table Layout along with the examples and outputs n detail.

HTML Input Placeholder HTML Input Placeholder Sep 04, 2024 pm 04:54 PM

Guide to HTML Input Placeholder. Here we discuss the Examples of HTML Input Placeholder along with the codes and outputs.

HTML Ordered List HTML Ordered List Sep 04, 2024 pm 04:43 PM

Guide to the HTML Ordered List. Here we also discuss introduction of HTML Ordered list and types along with their example respectively

Moving Text in HTML Moving Text in HTML Sep 04, 2024 pm 04:45 PM

Guide to Moving Text in HTML. Here we discuss an introduction, how marquee tag work with syntax and examples to implement.

HTML onclick Button HTML onclick Button Sep 04, 2024 pm 04:49 PM

Guide to HTML onclick Button. Here we discuss their introduction, working, examples and onclick Event in various events respectively.

See all articles