简体   繁体   中英

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

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-bottom: 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM