lchosts Posted September 27, 2011 Share Posted September 27, 2011 So general layout question here... which method is proper styling? obviously this is a dumbed down example of all the elements and stuff Ill be working with but just curious if it was better to list 1 style multiple times or 1 class or ident or whatever multiple times. I wanna be as professional as I can be in my writing so Im trying to learn proper techniques now #example1 {color: red;height: 43px;border: 1px solid black;} #example2 {color: red;height: 10px;border: 1px solid green;} #example3 {color: red;height: 100px;border: 1px solid purple;} OR#example1, #example2, #example3 {color: red;} #example1 {height: 43px;border: 1px solid black;} #example2 {height: 10px;border: 1px solid green;} #example3 {height: 100px;border: 1px solid purple;} Link to comment Share on other sites More sharing options...
Ingolme Posted September 27, 2011 Share Posted September 27, 2011 There is no defined better practise for this case.If it's just for one property, I wouldn't bother using the multiple selectors, but you can save a lot of code if you have many elements with the same kind of style. Link to comment Share on other sites More sharing options...
lchosts Posted September 27, 2011 Author Share Posted September 27, 2011 another question for ya... the rounded borders for instance... I think its firefox that uses a border command that works well but is not 'validated' how proper is it to bypass that via javascript or is there a better less... shady way to work around that problem. Link to comment Share on other sites More sharing options...
Ingolme Posted September 27, 2011 Share Posted September 27, 2011 I'm not sure what you're referring to. Link to comment Share on other sites More sharing options...
lchosts Posted September 27, 2011 Author Share Posted September 27, 2011 -moz-border-radius dosent validate in http://validator.w3.org/#validate_by_input I figured if I could get the site validated it would be nice... Link to comment Share on other sites More sharing options...
Ingolme Posted September 27, 2011 Share Posted September 27, 2011 The HTML validator shouldn't care what your CSS is like. You don't need to worry about having valid CSS. Link to comment Share on other sites More sharing options...
ShadowMage Posted September 28, 2011 Share Posted September 28, 2011 You don't need to worry about having valid CSS.That's nearly impossible anyway if you want to use things like gradients, rounded corners, opacity, and any other number of new/proprietary properties. Any of the -moz, -webkit, -o or -ms properties will be invalid. All proprietary properties, like filter in IE, will be invalid. So, long story short, don't worry about your CSS. If it all works together like it's supposed to then you're good to go. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.