HTML elements and attributes that you should avoid when making HTML pages

Source: Internet
Author: User
Tags define html tags version window
Web page

Bad HTML tags, we must not use in the production of Web pages.

This time it looks at some of the fairytale world and the prehistoric age of HTML tags. They are bad, dirty, utterly ugly, absurd attributes that are discarded by HTML standards, only partially working on a single version of the browser or a label that can be replaced by a new label.

It's been suggested that we not sing the praises of standards. Although we teach standards-based HTML and CSS, users (especially beginners) encounter bad entry and bad practices, and they don't know what went wrong. So our answer is: A guide to rejecting bad labels.

HTML has tried to remove performance and toward content development, leading to such a rationale: Separating content (HTML) from performance (CSS). This will give the Web a weight loss because a collection of performance instructions (in the form of an external CSS document) can be applied to multiple pages. This also makes the site easier to manage because global changes can be obtained from modifying a separate file.

Some of the bad tags are basically performance tags (such as small) that can be replaced with more meaningful and simple CSS rules. Others are not only for performance, but also for unnecessarily large (such as font tags) or hateful (such as blink) that is harmful to usability.

Label

Here are some of the tags you might encounter that you can have a better choice:

B can be used to produce bold elements. Use strong (meaning strong emphasis) instead of more meaningful, or use CSS to do this work, add font-weight:bold rules to indicate bold elements.
I can be used to produce italic elements. Use EM (for emphasis), which is also more meaningful. Or you can use CSS to express italics: font-style:italic
Big can produce larger fonts. Use headings (such as H1,H2, etc., when text is a title) instead, add meaning, or simply use the Font-size attribute in CSS to gain more control.
Small can produce small fonts. CSS (font-size) to gain more control over time.
HR can be used to show a horizontal line. In the CSS with the HR design is very rare, CSS Border-top,border-bottom attributes or simple image to do this effect will be better.
The above tags are compatible with the latest HTML standards, but there is no good label for content. They could be more useful but They aren ' t particularly harmful, and might easily is mistaken for innocent ' t Melt-in-their-mouth nuggets of pure goodness when standing next to the following tags.

u can underline an element. It reminds of the underlined text and many connection associations. That's why this label has been dead for a long time-you don't have to underline disconnected text.
Center can be used to center elements within an element. CSS Properties text-align allow not only center, but left, right, and justify.
menu is used to create a list of menus. It does not have the perfect UL, in because of unordered list more general, the UL stands high on the corpse of the menu.
Layer and DIV elements are similar, all by the extreme position of CSS. This only works in the old version of Netscape, so it's no use.
Blink or Marquee. Loudly Say no! They should be expected as much as they are, but with very limited support, and, it will only produce very, very disgusting jokes.
Font, which can be used to define the font name, size, and color of the element, and in the label World rightfully obtains the honorary title of the infamous label King. Old sites (and even new ones) are covered with the entire page like plague ants. Most of the font tag surges are brought from web-making software, and the font tag includes color and size used in every element. The font label is misused to appear in each of the current repeating elements (e.g., every time you use the P element), and CSS, you can use a short code to apply the repeating element, or even control the entire Web site. By using CSS, you can not only make a page thinner than a large number of font tags, but also easier to maintain because all you need to do is change the line in the CSS file, rather than modifying each font label one after another. This also increases the likelihood of maintaining a Web site that is consistent in its design style. The font label and inappropriate table usage are the two main reasons why Web pages are unnecessarily bloated.
Property

You may think you are using good labels, but there are still some troublesome parasite properties lurking in them that will pop up at any moment.

Name is used to specify a name for an element that is completely accepted in the form element of input, but elsewhere, name work has been replaced by the id attribute.
Text and bgcolor can define the basic text color and background color of the page in the Body Start tab. The color and Background-color properties of CSS can also be applied to the body selector.
Background can specify a background picture in the body tag. CSS will do better, using properties such as background-image to handle background images.
Link, ALink, Vlink are used in the body tag to specify the connection (not accessed, activated, and accessed). CSS Baby ──:link,: Active and: Visited will do the work.
Align can be used to align the content of an element (such as <div align= "center" >Stuff</div>), but, like the center tag, the CSS text-align attribute is the new boss.
Target can open a connection in a different way, most often by opening a new window (such as <a href= "wherever.html" target= "_blank" >help me</a>). Looks good, but you don't do this to your site. Users do not expect incredible things (such as new windows) to appear, and the most commonly used browsing tool is the browser's Back button, if you open a new window, this will not be available. It is illegal and not easy to use.
Attention

Preserves the performance properties of the label such as the width and height of the image, the cellpadding and cellspacing of the table, because these elements often use different values. This is not the perfect solution, but if your pages have lots of images and tables, you have no other sensible choice but to use them.
The most incomprehensible performance attribute is the TEXTAREA tag, which has only cols and rows two legitimate attributes, which are also necessary in the latest HTML version.
good label, bad use

To get into your bedroom you can bend over a dog hole, but wait, there's a hand-ready door for humanity! Wow, look--just right for one entry.

Use HTML tags (good tags), whether you believe it or not (believe it!) There is a good reason: you use them to have a good premise and you will have a better result.

The Web page itself is more accessible to users than HTML tag syntax semantics, and screen readers often highlight them when they encounter a UL tag or a H1 or H2 title tag.

The most abused form in the HTML tag world is the table. Tables are often used for layout purposes, but tables should only be used to show tabular data, as they are designed to do. Without a table layout method is not a Zen of enlightenment, it can not only significantly lose weight for Web pages, but also easier to maintain and redesign.

Attention

Sometimes the designer uses the tags and attributes mentioned here, especially with tables, to make a transition design--either working on older browsers (especially Netscape4) or working in modern browsers. The form does have a stronger performance control over the Netscape4 of the CSS. Unfortunately, these users are few and fewer, and there are more and more mobile device users glance the disadvantages of presenting table layouts. The above table-free design can prevent these drawbacks, although a small number of users have a slight performance change, but also in all of the browser to maintain the full functionality.
Framework

Goldilocks thought it was a good idea to have a cup of porridge, but three large carnivorous mammals popped up and threw her out of the window. The frame is a cup of porridge. They may look good, but they are at an endangered stage and will soon disappear.

Most Web sites don't use frames, and the average user takes a document as a page.

In some cases, if you want to prevent users from adding specific pages to bookmarks, and if you want users to use email or instant chat software to recommend specific pages, or you want to make the whole site very complex, so that users who use screen readers frequently operate between frames, or you want to confuse search engines, enough, You use the frame bar!

In summary, the framework only increases complexity and loses availability.

Attention

As long as you follow the following rules, you will not have a future to make mistakes:
1 a label or attribute even if only a little bit with the performance hook, do not use. That's the thing about CSS. and CSS to do better.
2 use the label as implied by its name. Table tags are used on tabular data. The title label is used on the title. Wait, wait.
3 The specific content with the appropriate label. List with lists, headings with HX (x = 1-7), and so on.

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.