rsalumpit Posted July 20, 2009 Share Posted July 20, 2009 name.city {color: blue} name[class=city] {color:blue} thnx... Link to comment https://forums.phpfreaks.com/topic/166602-whats-the-diff-between-this-two/ 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 Link to comment https://forums.phpfreaks.com/topic/166602-whats-the-diff-between-this-two/#findComment-878875 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. Link to comment https://forums.phpfreaks.com/topic/166602-whats-the-diff-between-this-two/#findComment-879346 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; } Link to comment https://forums.phpfreaks.com/topic/166602-whats-the-diff-between-this-two/#findComment-879400 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.