10 most easily made HTML tag errors

Source: Internet
Author: User

A good code style is a course that every coder must learn, also in the HTML design should pay special attention to the standardization of Code, although the code does not directly cause serious consequences, but it is likely to cause a certain user experience interference, but also reduce the search engine on the site's goodwill degree. This list contains 10 of the most easily made HTML tag errors, and write them down, allowing us to avoid making this common mistake, so that our HTML tags conform to semantics, and standard requirements.

Crime 1: Put the block-level elements inside the inline element

HTML elements behave in just two ways: block-level and inline. Each label has a default representation, not a block level or a row. Like Div and P are block-level elements that they use to form a document structure. Inline elements can only be within a fast-level element.

Crime 2:img label does not contain ALT attribute

The Alt property is a must for all pictures displayed in the Web page to help people know what the picture is. Or what is the meaning of the picture when the speed is slow. Its main purpose is to illustrate the meaning of the picture, like such a description alt= "image" is very bad. If, some pictures really just adornment function, then suggest you write alt= "".

Crime 3: Not using list when necessary

Crime 4: Use <b> and <i> to display bold characters and italic

You can define Font-weight and Font-style with CSS styles. If you must write a label on the page, replace it with a <strong> or <em> label. <b><i> doesn't have any semantics, but for a more concise page, choose the CSS definition style.

Crime 5: Use too much <br/>

<br/> Line-wrapping tags should only be used for inserts that are in the first text stream line break to knock a new line into a special word. It should not be used to create gaps between elements, but rather split into different paragraphs, or adjust the amplitude of the CSS style text.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.