Friday, 26 February 2016

Question on a school assignment.

So, I'm not asking for anyone to code anything for me or anything like that. So I have to make a "resume" type website for a class that I'm in and I got some points marked off for not using classes right, while I think I am right, and eventually got the instructor to see things my way, I just wanted to check with someone that actually does web design to see if this was acceptable.

So I have my HTML like normal,

<div id=content> <div class=leftarticle> <article /> </div> <div class=rightarticle> <article /> </div> </div> 

And then my CSS like this:

#content { css stuff } #content .leftarticle { css stuff } #content .leftarticle { css stuff } 

Is there any issue with nesting CSS like this? I haven't been able to find other articles on how to properly nest CSS like you would with Java/Python code. I have four main divs, wrapper, nav, content, footer. Each are ID'd, and have their own individual CSS, some have other nested CSS, for p, article, lists, whatever. His argument was that this is an improper use of ID/Class, and classes shouldn't be nested. My argument was that it's still a class regardless of whether it's locked behind and ID or not. So I'm looking for more opinions on the best approach to nest these, or to force classes to be inside of a specific ID.

Thanks!



Epic visual tool

Epson 5030UB 2D/3D 1080p 3LCD Projector Submitted February 26, 2016 at 10:24PM by rokd http://ift.tt/1UponUC

No comments:

Post a Comment