V
V
Vladimir Golub2016-03-31 06:13:42
css
Vladimir Golub, 2016-03-31 06:13:42

Why is there a gap between divs?

I type in Bootstrap, I didn't make any changes to the files.
The structure is as follows:

<div>
  <div>
     <button></button>
     <button></button>
  </div>
</div>

The main div is in the bootstrap column, its width is 100%, the div with the buttons is also 100%.
The buttons have a width of 50% and float left and right respectively.
As the width changes, there is a gap between them, what's the problem ? And even changing the width by 1px gives different results.
c6482fa95e1b46b29f5340b97a1a0544.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Ilya, 2016-03-31
@RazerVG

If you use bootstrap then form a grid using its classes, why bike:

<div class='container'>
  <div class='row'>
     <button class='col-xs-6'></button>
     <button class='col-xs-6'></button>
  </div>
</div>

---
The 'row' class removes just the same margins on the sides (margins of 15px). literature

K
khipster, 2016-03-31
@khipster

button {
margin: 0;
padding: 0;
}

S
shnicel, 2016-03-31
@shnicel

try this for example

<div>
  <div>
     <button class='col-lg-6 col-md-6 col-sm-6'></button>
     <button class='col-lg-6 col-md-6 col-sm-6'></button>
  </div>
</div>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question