Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

On my body, I have 3 images displayed horizontally.

Each image takes up 33% width.

Together, these 3 images take up the entire webpage.

How can I make these 3 images have a background size of cover, so their aspect ratio's are maintained?

body {
    background-image: url(https://images.pexels.com/photos/1546166/pexels-photo-1546166.jpeg),
                      url(https://images.pexels.com/photos/87223/pexels-photo-87223.jpeg),
                      url(https://images.pexels.com/photos/280221/pexels-photo-280221.jpeg);

    background-repeat: no-repeat, no-repeat, no-repeat;
    background-position: left, center, right;
    background-size: 33% 100%, 34% 100%, 33% 100%;
    width: 100%;
    height: 100vh;
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
3.3k views
Welcome To Ask or Share your Answers For Others

1 Answer

等待大神解答

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...