When Will html5 button labels be used? Why do mainstream websites still use the tag on non-jump buttons? -

Source: Internet
Author: User
If you build a website, you do not need to be compatible with the ie6-8. Is the use of the button tag more semantic? If you build a website, you do not need to be compatible with the ie6-8. Is the use of the button tag more semantic? Reply content: the html code of mainstream websites is well-secured (poor), not the first day.

Yes, if it is not a hyperlink jump, a should not be used, but button or input [type = button].

The problem with button and input is that because it is a form control, the styles that can be set on Some browsers or platforms are limited, or there is a style bug. Although this problem is getting fewer and fewer over time, bad habits have been developed. Sometimes it may be for a unified style.
You can see that some of the following lines are directed to new pages, some are not, but they all use the tag.

If a is used for redirect and a button is not used for redirect, it may seem inconsistent.
In this section: Why do mainstream websites still use the tag on non-jump buttons?

This is not mandatory, and the operators do not conform to the semantics. for developers, there is no obvious effect. Therefore, semantics is often a verbal expression.

Several developers strictly regulate each sentence of code they write to adapt to a false standard. If the meaning of a specification is not strong to a certain extent, most of them will not comply with this specification. This is what it means, especially with css3.
In addition, a is inline, And button is inline-block.
Using a may also benefit from a, but I did not study it. The link function is A, and the BUTTON function is BUTTON.
These two fundamental meanings are different.
Next, A is used to jump to the page. Without a button, I found that on firefox and Safari of the window platform, A user-defined style is added to the button by default, and the font cannot be modified through css, it's hard to see. I think the default expression style of tag a is different from that of button. The front-end must have accumulated a lot of frequently-used styles, such as the button styles of the tag. If you use the button tag, you need to re-write these styles. There is no need for me to write pages now, the a label is preferred.
Compatibility: after all, ie6 in China cannot be ignored. "a: hover" is quite useful when defining the mouse effect. There is also the "button" length adaptive problem, such as using rounded corners, shadows and other special effects, you can only use the background image, a tag can be nested span, etc., to achieve the effect. The button looks dull.

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.