Simple CSS alignment problem

Asked

Viewed 50 times

2

I’m 3 hours away from this simple problem, first course work.

I’d like to leave it at that:Gostaria de deixa assim

#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>

  • If you have solved your problem, mark as solved.

1 answer

4


Just use the 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>

Browser other questions tagged

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