Add a style to all html buttons

liunx

Guest
Hi,

Is it possible to make all html buttons red with a style sheet without using the class attribute.

Thanks a lot,
Chamal.Yes..... but no. According to the CSS spec you can, and in Mozilla you can. However, in Internet Explorer you cannot. And since IE still controls 85-95% of the market (depending on where you get your statistics) it is very impractical to make use of this feature.

Otherwise, you could have simply done,

input[type="button"], button { background-color: red }Yes...

How you do it depends exactly what you mean by 'button'. Are you talking about the html <button> tag? If so, then you'll just need to do something like this : button {
background-color:red;
}

If you're just talking about links, then you could use this : a:link {
color:red;
}
 
Back
Top