+ 4
Img
как в хтмл сделать так чтобы изображение было расположено сверху по центру https://code.sololearn.com/WP3jHbPnt1PN/?ref=app
3 odpowiedzi
+ 5
Google translate:
"as in xmlm to make so that the image was located from above on the center"
I think this means "vertically centered".
https://stackoverflow.com/a/7310398
Quote (many upvotes and bonus points)
"The only (and the best cross-browser) way as I know is to use an inline-block helper with height: 100% and vertical-align: middle on both elements. So there is a solution: http://jsfiddle.net/kizu/4RPFa/4570/"
+ 3
Thanks
+ 2
Via Calvin, in this thread:
https://www.sololearn.com/Discuss/760160/?ref=app
body {
display: flex;
height:100vh;
}
img {
margin: auto;
}
That worked for me here.