Place one block next to another with css

0

The following code simulates the original

.padre{
    border: 1px;
    display: inline-block;
    width: auto;
    margin: 0 20px;
    text-align: justify;
}
 <div class="padre">
       <div>
          <h2> HIJO 1 CON TEXTO</h2>
          <p> texto muy largo pero muy muy largo <p>
       </div>
       <div>
          <h2> HIJO 2 CON TEXTO MAS COOL </h2>
          <p> otro texto muy largo pero muy muy largo <p>
       </div>
    </div>

The problem I have is that, although my paintings are side by side, the texts are not evenly vertical. Apart the frames of the two boxes in the center are very close. How could I separate them without the margin of the page being uneven?

    
asked by GDeGilberto 01.11.2016 в 03:46
source

2 answers

1

Try this:

.padre{
   border: 1px;
   display: inline-block;
   width: auto;
   margin: auto;
   text-align: left;
}

What I did was to modify the alignment of the text and the atomic margins.

    
answered by 01.11.2016 в 04:01
1

I propose that you make a justified text and to the div you put an inner padding that reduces the space inside.

.padre{
    border: 1px;
    display: inline-block;
    width: auto;
    margin: auto;
    padding: 20px, 20px;
    text-align: justify;
}
    
answered by 01.11.2016 в 05:57