empty lines between content

I want to add empty spaces between text content in correct way (without using nbsp) to look like on image, how can I do that?

image

Index.html

    <div class="container-fluid" id="home">
<div class="row">
    <div class="col-md-8">
      <div class="row">
        <div class="col-md-5"></div>
        <div class="col-md-7">
               <h1>Text A</h1>
               <h1>Text B</h1>
               <h1>&nbsp;</h1><h1>&nbsp;</h1><h1>&nbsp;</h1><h1>&nbsp;</h1>
               <h1>Text after space</h1>
               <h1>&nbsp;</h1>
               <h1>&nbsp;</h1>
               <h1>Example</h1>
               <h1>Second examplei</h1>
        </div>
      </div>
    <div class="col-md-4"></div>
  </div>
</div>
</div>

CSS

h1{
margin: 0px;
padding: 1px 0;
line-height:1;
font-size: 28px;}

You could solve it with some simple css padding

Working Codepen Example

 .spacer {
     padding-top: 80px;
     padding-bottom: 40px
 }

Cheers :)


Please use padding css property. Padding-top:""; padding-bottom:""; would be fine.


.space { margin:0; padding:0; height:50px; } // height as desired

<div class="space"></div>

您可以替换此代码而不是<h1>&nbsp;</h1>

链接地址: http://www.djcxy.com/p/29434.html

上一篇: CSS形而上学:为什么页面垂直对齐如此困难?

下一篇: 内容之间的空行