3

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;}
Wojtkovy
  • 101
  • 3
  • 5
  • 15
  • Please look at the css property `margin` and play with it :) also suggest to read [margin vs padding](http://stackoverflow.com/questions/2189452/when-to-use-margin-vs-padding-in-css) to know the difference. Take the time to learn, goodluck! – nkmol Mar 02 '16 at 12:50

3 Answers3

3

You could solve it with some simple css padding

Working Codepen Example

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

Cheers :)

Marc Hjorth
  • 1,508
  • 2
  • 14
  • 22
1

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

Fazil Abdulkhadar
  • 1,017
  • 5
  • 11
0
.space { margin:0; padding:0; height:50px; } // height as desired

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

You can replace this code instead of <h1>&nbsp;</h1>

Sharon
  • 44
  • 2