View Single Post
Old 08-08-2020, 09:24 AM   #11
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,361
Karma: 20212223
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Quote:
Originally Posted by hobnail View Post

It seems to me that I could instead use
Code:
div.poem, div.letter, div.telegram, etc. {
    /* common block stuff here */
}
div.poem {
    /* poem specific stuff here */
}
I don't know if one is better than the other.
That's the technique I use, but I don't enumerate the common block selectors:

Code:
div {
    /* common block stuff here */
}
div.poem {
    /* poem specific stuff here */
}
div.letter {
    /* letter specific stuff here */
}
div.news {
    /* news article specific stuff here */
}
div.email {
    /* email specific stuff here */
}
As long as the common stuff is listed first, any specific changes listed below have priority. It may not be 'better' but it makes the code a little simpler/shorter... I don't need to see the word 'block' on every div...I already know it's a block because it's in a div tag.

Last edited by Turtle91; 08-08-2020 at 09:28 AM.
Turtle91 is offline   Reply With Quote