The Little Guy Posted June 12, 2007 Share Posted June 12, 2007 is it possible to apply style to objects that are of certain type? So... if I only wanted to apply style to inputs, where the input type is a submit button, and NOT a checkbox, radio button, select box, and so on... How would I be able to do that? I would also like to not use a class. Is this even possible? Quote Link to comment Share on other sites More sharing options...
akitchin Posted June 12, 2007 Share Posted June 12, 2007 this is called an attribute selector. it will work, but only in those browsers that support it (it should be noted that IE does NOT support it, making it relatively useless): input[type=submit] { style here; } or input[type=button] { style here; } although you don't want to use a class, it might be your only option supported well enough to make it worthwhile. Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted June 12, 2007 Author Share Posted June 12, 2007 OK... cool thanks works perfect. Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted June 12, 2007 Share Posted June 12, 2007 you can give your inputs an id or class (class can be applied to mulitple elements on one page) and use that to style them. Admittedly its not as nice as the attribute selector but it does work in more browsers. <input type="submit" class="bttn" name="submit" id="submit" value="Go" /> input.bttn { background: #ccc; color: #333; } note that some browsers on mac os DON'T style buttons anything like what you'd expect!!!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.