View Single Post
Old 01-24-2025, 04:29 PM   #17
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,796
Karma: 146391129
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by nabsltd View Post
Do you use padding so it doesn't collapse? I use margin-bottom: 0.1em; specifically because I want it to collapse if the next paragraph happens to have a larger top margin (like after a section break).
When I used to use space followed by a non-indented paragraph I used a bottom-margin. But the space can get lost if it's at the bottom of the page. So I switched to a padding-bottom and it kept the space so the space could wrap to the next page.

Now I use a 20% 2px line with space above and below for a section break because it looks better and uses less space.

I also use just <p> for most paragraphs as I don't need a class there. Here is the code I use for a section break.

CSS:
Code:
hr {
  margin-top: 0.9em;
  margin-right: 40%;
  margin-bottom: 0.9em;
  margin-left: 40%;
  border-top: 2px solid;
}
hr + p, p.nonindent {
  text-indent: 0;
}
Here is the HTML code for the section break.

HTML:
Code:
<hr/>
<p>

Last edited by JSWolf; 01-24-2025 at 04:45 PM.
JSWolf is offline   Reply With Quote