skip to Main Content

How do I get rid of the white space between the header/Title and body? I would like them to have no space or at least change that white space area to be a matching gray background like the body has.

enter image description here

</div>
    <div class="columns">
      <p class="thumbnail_align">&nbsp; </p>
      <h4 class="secondaryWindowHeader1">TITLE</h4>
      <p class="secondaryWindowBody2">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud.</p>
    </div>

3

Answers


  1. The <p> and <h4> elements both come with some built-in margin in most (all?) browsers. You can remove it by hand by setting margin: 0, like this:

    p{
      background: blue;
      margin: 0;
    }
    
    h4{
      background: green;
      margin: 0;
    }
    </div>
        <div class="columns">
          <p class="thumbnail_align">&nbsp; </p>
          <h4 class="secondaryWindowHeader1">TITLE</h4>
          <p class="secondaryWindowBody2">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud.</p>
        </div>
    Login or Signup to reply.
  2. </div>
        <div class="columns">
          <p class="thumbnail_align">&nbsp; </p>
          <h4 class="secondaryWindowHeader1" style="margin:0;">TITLE</h4>
          <p class="secondaryWindowBody2" style="margin:0;">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud.</p>
        </div>
    Login or Signup to reply.
  3. Add this to the top of your css, this is a good practice to remove all default paddings and margins:

     * {
          margin: 0;
          padding: 0;
          box-sizing: border-box;
       }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search