开发者

How to force html/css padding/margin on an element?

开发者 https://www.devze.com 2023-04-08 05:53 出处:网络
How can I add/force bottom margin/padding to the following <a> element ? <p> <h31>Testing?</h31>

How can I add/force bottom margin/padding to the following <a> element ?

<p>
    <h31>Testing?</h31>
    <a style="margin-bottom: 200px">Create a new Entry</a>        
    testing padding
/*more stuff here...*/

Styles are very convoluted and the margin-bot开发者_StackOverflowtom: 200px is not forcing the padding after the <a> element.


The margin CSS property doesn't work as expected when the elements are inline. Add display:block, or display:inline-block (in your case) to enable margins on inline elements (such as anchors).

The padding property is usually applied without trouble.

0

精彩评论

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