aitor
aitor

Reputation: 2735

Responsive image behavior

I have this responsive page:

http://iac.e451.net/perfil.html

But I can't fit image width to upper div column width:

http://iac.e451.net/perfil-2.html

(.img-responsive class doesn't work neither)

How can I make it?

Thank you!

This is the HTML:

<div class="row row-imagen">
        <div class="col-centro col-sm-6 col-lg-5 col-sm-offset-4">
        <div class="cont-imagen">
            <img src="dist/img-contenido/imagen.jpg" alt="" class="img-perfil">
        </div>
    </div>
</div>

And this is de CSS/LESS

  .row-imagen {
    background-color: white;
    padding-top: 15px;
    padding-bottom: 15px;
    .cont-imagen {
      max-width: 100%;
      img {
        max-width: 100%;
      }
    }

The problem is that image width doesn't fit upper div width (class .col-centro)

Upvotes: 0

Views: 374

Answers (1)

aitor
aitor

Reputation: 2735

Solved. The problem was a bad use of "max-width" property. I have changed it to "width" and it works. Here is the same problem related:

How to set max width of an image in CSS

Upvotes: 0

Related Questions