How do I create a vertical spacing between Ivs in css?

Asked

Viewed 292 times

-3

I have the following problem, I created a component of a button and I put it inside a div, I replicated bone for 3 buttons, I wanted to know if you have any property in css to give a vertical spacing between these buttons. I tried with line-height, but it worked, because I think it works only for text. inserir a descrição da imagem aqui

  • Important you [Dit] your question and explain objectively and punctually the difficulty found, accompanied by a [mcve] of the problem and attempt to solve. To better enjoy the site, understand and avoid closures and negativities worth reading the Stack Overflow Survival Guide in English.

2 answers

2

You can use the property of css padding, if you want vertical spacing use padding-bottom or padding-top, if you want horizontal padding-left or padding-right. It is possible to combine more than one of them also.

To use would be like this:

In the css file:

.exemplo{
  padding-bottom: 10px; //Se quiser que seja relativo usa com % ao invés de px
}

In html file:

<div class="exemplo">
....
<div>

0

in css put like this:

div {
   margin-bottom: 10px;
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.