rsalumpit Posted July 20, 2009 Share Posted July 20, 2009 name.city {color: blue} name[class=city] {color:blue} thnx... Quote Link to comment Share on other sites More sharing options...
rhodesa Posted July 20, 2009 Share Posted July 20, 2009 nothing...except that the first is the current way, which is universally supported, and the second is the "future" way with CSS3...which is not yet widely supported but they are meant to accomplish the same thing Quote Link to comment Share on other sites More sharing options...
jayjay960 Posted July 21, 2009 Share Posted July 21, 2009 I haven't seen the second one before.. I don't like the idea of having to switch to doing it that way. It seems a bit unnecessary. Quote Link to comment Share on other sites More sharing options...
rhodesa Posted July 21, 2009 Share Posted July 21, 2009 on the contrary, it's FANTASTIC. inside the brackets you will be able to have any attribute. for example, say you have a site and you want to change the style of it. let's set the width of all our <input type="text"> elements to 120px. in our stylesheet, we can't use something like this: input { width: 120px; } because that will change all our buttons and checkboxes too. so the only option is to add a class to EVERY text input on the site. but with CSS3 we can just do: input[type="text"] { width: 120px; } 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.