gauravmunjal84 / prj-rev-bwfs-dasmoto

0 stars 0 forks source link

Rather than selecting div, it might be better to give the div a class #1

Open jzhu01 opened 7 years ago

jzhu01 commented 7 years ago

Seen here: https://github.com/gauravmunjal84/prj-rev-bwfs-dasmoto/blob/master/Dasmoto/resources/css/index.css#L11

Since div is very general, it might be useful to give it a class.

gauravmunjal84 commented 7 years ago

While styling I followed the rule i read in one of the lessons and that is to set the specificity to the least whenever possible, so I prioritized elements over classes and classes over ID's . I got your point, i got away with using div's because it was a smaller project, in bigger projects it will be better to give classes to div . Any thoughts on specificity ?

jzhu01 commented 7 years ago

I recommend being more specific to be honest, in the long run it's better, since usually you'll be working on big projects. In terms of specificity, I'd say making it something that you'd be able to remember why you styled it like so, or what it refers to is good. You want someone else who's unfamiliar with your code to be able to read through it and understand the logic. :)