gpt4 book ai didi

图像 css 最大宽度没有扭曲

转载 作者:太空宇宙 更新时间:2023-11-04 04:15:11 24 4
gpt4 key购买 nike

Goody,想知道如何拉伸(stretch)图像以适合宽度而不扭曲高度?也许只显示图像的中心部分?这是网站:

http://youthicons.my/2013/11/lorem-ipsum-dolar-sit-amet/

和css部分:

.featured-image, .featured-img{ top: 0; width: 100%; height: 537px; left: 0;}

谢谢!

最佳答案

height: auto; 而不是实际图像上的 height: 537px

如果你不想让它变得太大,你可以在 div 上设置高度并设置 `overflow: hidden;'

关于图像 css 最大宽度没有扭曲,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20062644/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com