How to set an image's width and height without stretching it?

前端 未结 12 1588
南旧
南旧 2020-11-28 05:22

If I have:

#logo {
    width: 400px;
    height: 200px;
}

then


12条回答
  •  南方客
    南方客 (楼主)
    2020-11-28 05:34

    What I can think of is to stretch either width or height and let it resize in ratio-aspect. There will be some white space on the sides. Something like how a Wide screen displays a resolution of 1024x768.

提交回复
热议问题