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 elementThere 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 attributeThe 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 necessaryCrime 4: Using <b> and <i> to make text bold and italicYou 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 |
<<: CSS Tricks to Create Wave Effects
>>: Vue-CLI3.x automatically deploys projects to the server
Preface This article mainly shares with you an ex...
1. CSS realizes fixed width on the left and adapt...
Explain the whole process of CLion from scratch. ...
This article is part of a special series on the 2...
The first time I used the essay, I felt quite awkw...
The result (full code at the bottom): The impleme...
Build the image There are two main ways to build ...
1. What is a proxy server? Proxy server, when the...
This article uses examples to illustrate the sear...
Regarding the high-performance distributed memory...
This article mainly introduces the relevant solut...
This article shares the specific code of JavaScri...
Prerequisite: Save the .frm and .ibd files that n...
This article example shares the specific code of ...
Click here to return to the 123WORDPRESS.COM HTML ...