Image misaligned by decreasing page width

0

So is the resolution of my image in the normal width of the page

Butbydecreasingthewidthofthepagetheimagelookslikethis.

Iwouldliketheimagetobethesamesizeasthe1smallimage

HTML

<divclass="col-6 col-md-4">
            <img src="imagens/eccomerce.JPG" alt="principal" id="imagem_principal">
        </div>

CSS

#imagem_principal{
            width: 92%;
            height: 240px;
        }
    
asked by anonymous 10.10.2017 / 16:02

1 answer

1

Your CSS is apparently not being applied to the image. In the html that passed this being used a ID #imagem_principal and the CSS is in a CLASS .imagem_principal.

As you are using bootstrap you can add a class ="img-responsive" that might work or if you prefer, change your html by class="imagem_principal" and your css

.imagem_principal{
height: auto;
max-width: 100%;
}

Another problem that happens is that when your screen gets smaller, your html (bootstrap) is getting full page width, the default xs-12. To do this, add a -xs tag to control the width of the screen at smaller resolutions, this will prevent the layout from breaking in several lines and your image will occupy 100% of the screen ..

<div class="col-6 col-md-4 col-xs-4">

    
10.10.2017 / 16:37