.page-docs { &.ng-leave { transform-origin: 50% 50%; animation: rotateOutNewspaper .3s both ease-in; } &.ng-enter { animation: scaleUp 0.3s both ease-in } } .documents-block { margin: 3em 0 0; display: flex; flex-wrap: wrap; justify-content: space-around; align-items: baseline; } .doc { margin: 0 1.2em 2.5em; p { text-align: center; } img { max-width: 100%; } } @media (max-width: 31.25em) { .documents-block { margin: 1em 0 0; } .doc { margin: 0 0 2em; } }