View Single Post
Old 01-30-2020, 03:36 PM   #88
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 1,591
Karma: 14328510
Join Date: Nov 2019
Device: none
Quote:
Originally Posted by Argon View Post
Can anyone help me with this?
Not answering your question, or maybe it will work if you did it this way, but I prefer to have my divs not be generic and assign specific classes to them. My top level formatting for blocks that are separate from the running text is

Code:
div.block {
    margin-left: auto;
    margin-right: auto;
    margin-top: 1em;
    width: 85%;
}
Then for the paragraphs within and after them

Code:
div.block + p {
    margin-top: 1em;
}

div.block p {
    margin-top: 0.25em;
    text-indent: 0em;
}
Then for a specific type of block, e.g., an article

Code:
div.article {
    font-family: sans-serif;
}
Then in the html it's a double-barrelled class 'div class="block article"'.

Alternatively you could dispense with the block class and chain all of the different div types together for the common stuff; e.g.

Code:
div.article, div.note, div.letter {
    margin-left: auto;
    margin-right: auto;
    margin-top: 1em;
    width: 85%;
}
and then have div.article the same as above.
hobnail is offline   Reply With Quote