Skizit
Skizit

Reputation: 44862

force a <br /> at end of div

I'm wondering is there a way of doing the following using CSS alone. When </div> is called on a specific div that a <br /> would be added.

Upvotes: 0

Views: 767

Answers (2)

Marcus Whybrow
Marcus Whybrow

Reputation: 20008

div:after {
    content: '<br />';
}

Doesn't do what you want it to do, but it does literally.

Upvotes: -1

BoltClock
BoltClock

Reputation: 724532

If you're looking to create a gap below your <div>, in most cases giving it a bottom margin will do the trick:

#some-div {
    margin-bottom: 1em; /* Adjust depending on your text's line-height */
}

Upvotes: 3

Related Questions