How to align a div with inline-block display?

0

I have a news feed that consists of two divs inline-block .

1st - The first contains the title and image of the news ( left ). of the news ( right ).

I would like even if the paragraphs of the news content vary from news to news, it aligns itself to the center of the div from the left.

Something like this:

How can I get this result? (sorry for photoshop skillz)

    
asked by anonymous 10.07.2017 / 19:29

1 answer

0

Hello,

You can place them side by side using float. Hence the width will be respected, and no matter how much text you put in the right div.

Here is an example code:

    <div class="div-esquerda">
       img and titulo
    </div>

    <div class="div-direita">
       linhas e linhas de conteudo
    </div>

    <style type="text/css">
       .div-esquerda {
          width: 40%;
          float: left;
       }

       .div-direita {
              text-align: center;
              float: right;
              width: 55%;
       }
    
10.07.2017 / 19:36