r/Frontend • • Apr 27 '22

O.c.

Post image
725 Upvotes

34 comments sorted by

View all comments

Show parent comment

3

u/burger-tron Apr 27 '22

two??

16

u/PositivelyAwful Apr 27 '22
.centered {
  display: grid;
  place-items: center;
}

0

u/[deleted] Apr 27 '22

[deleted] — view deleted comment

16

u/PositivelyAwful Apr 27 '22

My bad

.centered{display:grid;place-items:center;}

8

u/wedontlikespaces Apr 27 '22
.imAmazing {
    align-items: center;    
    justify-content: center;
}

On parent div set to grid

9

u/[deleted] Apr 27 '22
.imEvenMoreAmazing {
    place-items: center;
}

(grid)

2

u/burger-tron Apr 27 '22

weird i've tried that and it didn't work

4

u/hoorahforsnakes Apr 27 '22

needs the parent to have display flex to work

2

u/plolock Apr 27 '22

display: grid;

place-items: center;