View Single Post
Old 08-09-2025, 04:49 PM   #34
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,368
Karma: 20212733
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
That’s exactly right, divs are generic containers while blockquotes are semantically used specifically for long quotes in a block format. While you can style the blockquote to look however you want it wouldn’t be semantically correct to use it for an image wrapper or something. It is more proper to use the div when there isn’t a more semantically correct tag. And then give it a descriptive class:

Code:
<div class="poem">
  <p>line of text</p>
  <p>line of text</p>
  <p>line of text</p>
</div>

<div class="book">
  <p>line of text</p>
  <p>line of text</p>
  <p>line of text</p>
</div>

<div class="email">
  <p>line of text</p>
  <p>line of text</p>
  <p>line of text</p>
</div>

<div class="textmsg">
  <p>line of text</p>
  <p>line of text</p>
  <p>line of text</p>
</div>
Code:
div.poem {style the div container here}
div.poem p {style the lines in the div here}

div.book {style the div container here}
div.book p {style the lines in the div here}

Etc, etc, etc…
There is a valid argument that you don’t need to use a <p> inside a div when a more semantically correct tag would do, such as <li>…. But if you were going to use <li> I would just style the <ol>/<ul> instead of putting it inside a div in the first place.
Turtle91 is offline   Reply With Quote