CSS attribute selectors
Every single day I learn some new CSS tidbit I didn’t know. Never before did I realize that there was an attribute selector for CSS!
As I was working on the stylesheet for our latest project, Way Cool Mail, I realized I wanted a slightly different style on buttons then I did on text input fields. So I made a class for the buttons and applied it every where I used a button. (I thought about overriding Rails button helper to always use that class. But that seemed dirty.)
Now I discovered via CSS Mastery: Advanced Web Standards Solutions that one can do something like this:
input[type="submit"] {
border: 1px solid #000
}Of course, it doesn’t work in IE6 and below. (ARGH!!!). So I’ll either have to keep the separate class or try this handy JS trick.
Trackbacks
Use the following link to trackback from your own site:
http://blog.kineticweb.com/articles/trackback/50
