Simple CSS alignment problem

2

I am 3 hours with this simple problem, first course work.

I'd like to leave it like this:

#conteudo{
  background-color: #F5F5F6;
  position: absolute;
  width: 80%;
  top: 20%;
  right: 10%;
}

.bloco{
  display: inline;
}

.bloco img{
  height: 212px;
  padding-top: 20px;
  padding-left: 20px;
}
  <div id="conteudo">
    <div class="bloco">
        <img src="https://feitocasulo.files.wordpress.com/2009/12/capa-quadrada.jpg" />
        <h1>Texto exemplo</h1>
    </div>
  </div>
    
asked by anonymous 30.10.2017 / 20:13

1 answer

4

Just use float: left;

#conteudo{
  background-color: #F5F5F6;
  position: absolute;
  width: 80%;
  top: 20%;
  right: 10%;
}

.bloco{
  display: inline;
}

.bloco img{
  height: 212px;
  padding-top: 20px;
  padding-left: 20px;
  float: left;
}
<div id="conteudo">
    <div class="bloco">
        <img src="https://feitocasulo.files.wordpress.com/2009/12/capa-quadrada.jpg" />
        <h1>Texto exemplo</h1>
    </div>
  </div>
    
30.10.2017 / 20:16