DaniSpringer.com DaniSpringer.com - 5 months ago 8
HTML Question

Empty Space Between Divs?

I'm using a framework with a 12 column grid (bootstrap).

On my first

row
, I have one
div
taking up 10 columns, and one taking up 1 column.
Of course, that takes up 11 out of 12 columns.

Must I use all twelve columns, or is there a way to insert empty space between divs?

Answer

I changed col-9 to col-10, and instead of applying margin-right to the div holding the h1 and h4, I added it to each one directly (perhaps there is a better way, like A B {}.

So:

HTML:

<div class="row">
    <div class="col-2"><img src="images/logo.png" width="100px" height="100px" alt="Logo" />
    </div>
    <div class="col-10 titolo">
      <h1>DANI SPRINGER</h1>
      <h4>FRONT-END NINJA</h4>
    </div>
  </div>

CSS:

h1 {
    margin-right: 5px;
}

h4 {
    margin-right: 5px;
}

.titolo {
    text-align: right;
}

result