[personal profile] aldro posting in [community profile] style_system
I sometimes post a line (code is <hr>) in my entries to seperate topics and I noticed that the line doesn't spread out over the entire lenght of my entry holder, like it should and does in some of my friend's posts. I don't know if that's due to some code in my CSS or if there's another reason for this. However, I would like to change it. Does anybody know how?

P.S. I don't have an example image, but I can make one if necessary. Thanks in advance!

Date: 2011-05-17 03:26 pm (UTC)
blnchflr: Remus/Ghost!Sirius (html)
From: [personal profile] blnchflr
Looks like it stems from this bit in the css stylesheet:

.entry-content hr,
.comment-content hr {
display: block;
margin: 1em 10%;
}


You can input the edited css here: http://www.dreamwidth.org/customize/options?group=customcss - I assume this would work:

.entry-content hr,
.comment-content hr {
margin: 0;
}


I'm not actually sure what display: block does for a horizontal line, but I'm sure someone else does.

Date: 2011-05-17 04:01 pm (UTC)
adalger: Earthrise as seen from the moon, captured on camera by the crew of Apollo 16 (Default)
From: [personal profile] adalger
It doesn't do anything. hr is a block element by definition. A little experimentation leads me to believe you can't inline it, even if you wanted to.

Date: 2011-05-17 04:28 pm (UTC)
zvi: self-portrait: short, fat, black dyke in bunny slippers (Default)
From: [personal profile] zvi
?? Block elements have margins. What are you talking about?

Date: 2011-05-17 06:27 pm (UTC)
adalger: Earthrise as seen from the moon, captured on camera by the crew of Apollo 16 (Default)
From: [personal profile] adalger
Here's a reference. And another. Although I suppose it's open to interpretation, as the standard only lists block as a typical default display property, so "by definition" may have been an erroneous characterization.

At any rate, I was unable to persuade an hr element to allow any content to its left or right by putting { display:inline; } in its styling, but that may be peculiar to IE7. I'll try later when I have access to Chrome.

Date: 2011-05-17 06:56 pm (UTC)
zvi: self-portrait: short, fat, black dyke in bunny slippers (Default)
From: [personal profile] zvi
Yesss, but I think the op's issue was with the margin amounts, not defining a block element as a block element.

Date: 2011-05-17 07:37 pm (UTC)
adalger: Earthrise as seen from the moon, captured on camera by the crew of Apollo 16 (Default)
From: [personal profile] adalger
Oh! I think I see what happened. My brain often just assumes that the context I'm thinking when I write something should be magically obvious to everyone in the universe everywhere, and I responded to just the bit about what display:block does. Without, of course, providing any indication at all that I was talking about just that. So, yes, of course, you're absolutely correct; block elements have margins, and the css [personal profile] blnchflr provided very nicely corrects the op's issue. But because my brain insists on believing my context is the only one that exists, I didn't even make the connection when you EXPLICITLY MENTIONED MARGINS that you were taking my comment as attaching to a different part of the parent comment than the part I intended.

Date: 2011-05-17 06:33 pm (UTC)
syntheid: [Elementary] Watson drinking tea looking contemplative (Default)
From: [personal profile] syntheid
Well you can inline it, it's just kind of. It's no longer a horizontal line. And apparently you can't really do anything with it at that point. But you can also set it to display: inline-block, which makes it horizontal, but inline. So it ... may have been doing something at some point to explicitly declare display: block, but who knows.

Date: 2011-05-28 12:55 am (UTC)
marahmarie: (M In M Forever) (Default)
From: [personal profile] marahmarie
not actually sure what display: block does for a horizontal line

My guess: it separates it presentation-wise from the rest of the style elements. So it doesn't wrap into sentences above and below it, for example. And so you can set margins for it so it won't hang right under the last sentence and right over the next one (because the point of hr is to put lots of space between your last set of thoughts and your next, within one post - to change the subject entirely, in other words).

Profile

Dreamwidth style system discussion

July 2025

S M T W T F S
  123 45
6789101112
13141516171819
20212223242526
2728293031  

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Aug. 31st, 2025 08:55 pm
Powered by Dreamwidth Studios