U
U
Underdoggit2018-05-14 13:29:57
css
Underdoggit, 2018-05-14 13:29:57

Align gallery to center?

https://goreska.github.io/nlalmaty/
5af9651a7441c867511507.png
I can't position the gallery block on the adaptive, on the desktop version I aligned the block with flexes, wrapped it in wrap, and aligned justify-content: centerit, setting the wrapper width to 100% and the gallery width to 90%. But on mobile - width 575 for example - the block is again pressed to the left edge. Help.
UPD, for a resolution of 575, the output was found in the form of transform -50%, the blocks are positioned in the center, but if we apply the same transform for a resolution of 768, let's say, the blocks overlap each other

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dymok, 2018-05-14
@UnluckySerivelha

If so try?

@media screen and (max-width: 575px) {
  .grid-item {
    left: 50% !important;
    transform: translateX(-50%);
  }
}

C
CODALSD, 2018-05-14
@CODALSD

@media (max-width: 575.98px)
.grid {
    width: 50vw;
}
.grid-item {
   width:100%;
}

As an option, but the pictures will cut a little

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question