- This topic is empty.
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- The forum ‘Design’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
I’m trying to set the image center horizontally to the parent DIV, i googled it, there is a lot of examples, but no one of them really work good, i mean, it’s working but destroy other parts of my style.
Is there any simple build in code, that tell to the Element, “You are center horizontally of your parent”?
image center horizontally to the parent DIV
margin:auto; display:block;
would horizontally centre an image within the parent container.
For vertical centering, look in to flexbox; try making the grey div a flex container, then you can set the align-items
property to center.
You could also try CSS tables.
Full guide here https://css-tricks.com/centering-css-complete-guide/
Thanks! You so good!!