Div leaving the right side of the page in animation

Asked

Viewed 83 times

3

I have a div that is a mobile phone and when I go down the page performs the animation but before performing the animation this div ta getting off the page breaking all the layuout

my div

<div class="col-md-5 ml-auto">
    <div class="iphone-container" style="max-width: 450px !important;" [@scrollAnimation]="state">
        <img src="assets/img/iphone6-2.png">
    </div>
</div>

She gets this white band and smartphones are much bigger inserir a descrição da imagem aqui

as the animation is executed the track some pq the image is in its correct position placing overflow: hidden I managed to limit the error but then it’s like she’s gone out of the middle of the page gets ugly

inserir a descrição da imagem aqui

1 answer

2


I believe that putting a overflow on the axis X in the HTML and in the body should solve your problem.

    html,
    body {
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
        overflow-x: hidden;
    }
  • It worked obg but testing also realized that if I paste the animation in the image instead of putting in the whole div works which would be the best way?

  • @Giovannidias I particularly like to always use the overflow-x: Hidden; because I never use horizontal scroll. This class serves precisely to hide everything that is larger than the width of the screen, avoiding the horizontal scroll in the window. But if putting in the picture solved sometimes you don’t need this overflow artifice

Browser other questions tagged

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