+ 4

Img

как в хтмл сделать так чтобы изображение было расположено сверху по центру https://code.sololearn.com/WP3jHbPnt1PN/?ref=app

3rd Oct 2017, 1:06 PM
Liluxa
Liluxa - avatar
3 Answers
+ 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/"
3rd Oct 2017, 3:29 PM
Kirk Schafer
Kirk Schafer - avatar
+ 3
Thanks
3rd Oct 2017, 5:15 PM
Liluxa
Liluxa - avatar
+ 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.
3rd Oct 2017, 5:07 PM
Kirk Schafer
Kirk Schafer - avatar