开发者

force a <br /> at end of div

开发者 https://www.devze.com 2023-02-02 23:53 出处:网络
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.If you\'re looking to create a gap

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.


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 */
}


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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消