css margin-bottom属性怎么用

互联网 19-5-29
css margin-bottom属性用于设置元素的下外边距,允许使用负值。所有主流浏览器都支持 margin-bottom 属性。

css margin-bottom属性怎么用?

margin-bottom属性设置元素的下外边距。

可设置的属性值:

● auto:浏览器计算下外边距。

● length:规定以具体单位计的下外边距值,比如像素、厘米等。默认值是 0px。

● %:规定基于父元素的宽度的百分比的下外边距。

● inherit:规定应该从父元素继承下外边距。

说明:该属性允许使用负值。

注释:所有主流浏览器都支持 margin-bottom 属性。

css margin-bottom属性 示例

<!DOCTYPE html> <html> <head> <style type="text/css"> p.bottommargin {margin-bottom: 2cm} </style> </head> <body> <p>这个段落没有指定外边距。</p> <p class="bottommargin">这个段落设置了2厘米的底边距。</p> <p>这个段落没有指定外边距。</p> <p>这个段落没有指定外边距。</p> </body> </html>

以上就是css margin-bottom属性怎么用的详细内容,更多内容请关注技术你好其它相关文章!

来源链接:
免责声明:
1.资讯内容不构成投资建议,投资者应独立决策并自行承担风险
2.本文版权归属原作所有,仅代表作者本人观点,不代表本站的观点或立场
上一篇:php获取远程图片并下载保存到本地的方法分析 下一篇:css list-style-type属性怎么用

相关资讯