View Single Post
Old 12-08-2023, 08:03 PM   #174
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
I know we've had this conversation before, but I wanted to add my to KevinH's comment.

I (almost always) use "empty spans" when styling with descendant combinator classes. These are very specifically defined and do not need any ID or CLASS to determine the styling. For example:

Code:
<h3>Chapter 1 <span>Chapter Title</span></h3>

h3      {bold,center, yadda yadda}
h3 span {display:block, center, italic, font-size/font family, yadda}

-OR-

<div class="char">
 <p>some stuff</p>
 <p>some more stuff <span>extra info to be differentiated from main 
    line</span></p>
</div>

div.char      {margin,border, whatever}
div.char p    {basic paragraph style in this div}
div.char span {display:block, font-variant, bold...etc.}
Could I add a class to define it? Sure. But I don't have to. It's perfectly legal and unambiguously defined so there is no need to add "bloat" to the code.

I'm not the only one out there that does this, either. I have come across many books that use descendant combinator classes.

Cheers!
Turtle91 is offline   Reply With Quote