The most common mistakes in HTML tag writing

The most common mistakes in HTML tag writing

We better start paying attention, because HTML Police will walk through your code and pick out all your unsemantic tags . This list contains the 10 most common HTML tag errors . By noting them, we can avoid making these common mistakes and make our HTML tags meet the semantics and standards requirements.

Crime 1: Putting a block-level element inside an inline element

There are two ways to express HTML elements: block-level and inline. Each tag has a default expression, either block-level or inline. For example, div and p are block-level elements, which are used to form the document structure. Inline elements can only be inside block-level elements.

Crime 2: The img tag does not include an alt attribute

The alt attribute is a required attribute for all images displayed on a web page. It can help people know what the image is. Or it can show the meaning of the image when the Internet speed is slow. Its main purpose is to explain the meaning of the image. It is very bad to use alt="image" as an explanation. If some images are really just for decoration, then it is recommended that you write alt="".

Crime 3: Not using lists when necessary

Crime 4: Using <b> and <i> to make text bold and italic

You can use CSS to define font-weight and font-style. If you must use tags in the page, use <strong> or <em> tags instead. <b><i> has no semantic meaning, but for a simpler page, it is better to use CSS to define the style.

Crime 5: Using Too Much

<br />The line break marker should only be used to insert a particular word onto a new line after the first line break character is typed into the text flow. It should not be used to create gaps between elements, but rather to split text into different paragraphs, or to adjust the amplitude of CSS styles.

Crime 6: Using the wrong strikethrough tag

In the old days, <S> and <strike> allowed for defining site text. However, they are now defined as deprecated tags , while they still have an effect. Use the new set of tags - <del> and <ins>. To replace <s><strike>

Crime 7: Using inline styles

The most important purpose of CSS is to distinguish between documents and styles. If you write style into the page, then there is no use of CSS at all. So remember to put your style where it should be

Crime 8: Adding borders to HTML

Crime 9: Not using header tags <h1>-<h6>

Crime 10: Non-semantic <blink> or <marquee>

Not recommended by W3, the <blink> and <marquee> (flash, scroll) tags are pure ugliness.

Don't use this tag . If you must use this effect, I believe you will have other better effects.

<<:  CSS Tricks to Create Wave Effects

>>:  Vue-CLI3.x automatically deploys projects to the server

Recommend

Summary of 4 methods of div+css layout to achieve 2-end alignment of css

The div+css layout to achieve 2-end alignment is ...

Some points on using standard HTML codes in web page creation

<br />The most common mistake made by many w...

Method of using MySQL system database for performance load diagnosis

A master once said that you should know the datab...

Solution to the impact of empty paths on page performance

A few days ago, I saw a post shared by Yu Bo on G...

How to analyze SQL execution plan in MySQL through EXPLAIN

Preface In MySQL, we can use the EXPLAIN command ...

Tutorial on compiling and installing MySQL 5.7.17 from source code on Mac

1. Download and unzip to: /Users/xiechunping/Soft...

CSS implements six adaptive two-column layout methods

HTML structure <body> <div class="w...

Detailed explanation of the command mode in Javascript practice

Table of contents definition structure Examples C...

Detailed analysis of the usage and application scenarios of slots in Vue

What are slots? We know that in Vue, nothing can ...

How to start/stop Tomcat server in Java

1. Project Structure 2.CallTomcat.java package co...

Several ways to encrypt and decrypt MySQL (summary)

Table of contents Written in front Two-way encryp...

How to insert video into HTML and make it compatible with all browsers

There are two most commonly used methods to insert...