边框底部后如何添加空格?

时间:2015-12-15 11:28:42

标签: css css3

我可以知道如何在边框底部后添加空格/填充底部?样品如下所示。我不希望添加一些对象或制作它,只是希望使用" h2"只要。例如:

  

< h2> h2标题< / H2>   < p>下一个元素< / p为H.

非常感谢。

enter image description here

2 个答案:

答案 0 :(得分:2)

DEMO

h1 {
  margin-bottom:50px; /* space from border to next element */
  padding-bottom:10px; /* space from element to border */
  border-bottom:1px solid #aaa;
}

CSS box model - Reference

答案 1 :(得分:0)

您可以在css中使用margin-bottom:。就像在下面的代码和演示中一样。我以50px为例。

h2 {border-bottom:1px solid grey; margin-bottom:50px;}

<强> DEMO