Unified button design is implemented only with CSS

Source: Internet
Author: User

First, I declare that this solution was obtained through csdn, so it is helpful to ask questions on csdn.

 

The cause of the problem is that there are too many words in the button, which leads to serious deformation in IE. Therefore, we need to design a button style. There are only two options I can think:

 

One way is to add the class attribute in each input tag, and check the number of input tags and the number of pages. This is my intention to give up;

The other is to define the input in the CSS attribute, but all the input attributes have changed since then.

 

 

Here's the solution code:

 

 

 

<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = iso-8859-1"/>
<Title> untitled document </title>
<Style type = "text/CSS">
Input [type = button] {
Background: # ffffff none repeat scroll 0 0;
Border: 1px solid # dcdddd;
Color: #1e50a2;
Display: inline-table;
Float: left;
Margin: 5px 4px 0 0;
Padding: 2px 4px 1px 3px;
Text-align: center;
Vertical-align: middle;
}
Input [type = button]: hover {
Background: #1e50a2;
Color: # FFF;
}
</Style>
</Head>

<Body>
<Input type = "button" value = "button"/>
<Input type = "reset" value = "reset"/>
<Input type = "Submit" value = "Submit"/>
<Input type = "text" value = "text"/>
</Body>
</Html>

Related Article

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.