gpt4 book ai didi

css - 响应图像行为

转载 作者:行者123 更新时间:2023-11-28 07:09:20 24 4
gpt4 key购买 nike

我有这个响应式页面:

http://iac.e451.net/perfil.html

但我无法使图像宽度适合上部 div 列宽:

http://iac.e451.net/perfil-2.html

(.img-responsive 类也不起作用)

我怎样才能做到?

谢谢!

这是 HTML:

<div class="row row-imagen">
<div class="col-centro col-sm-6 col-lg-5 col-sm-offset-4">
<div class="cont-imagen">
<img src="dist/img-contenido/imagen.jpg" alt="" class="img-perfil">
</div>
</div>
</div>

这是 de CSS/LESS

  .row-imagen {
background-color: white;
padding-top: 15px;
padding-bottom: 15px;
.cont-imagen {
max-width: 100%;
img {
max-width: 100%;
}
}

问题是图像宽度不适合上部 div 宽度(class .col-centro)

最佳答案

已解决。问题是“最大宽度”属性的错误使用。我已将其更改为“宽度”并且可以正常工作。这是相同的相关问题:

How to set max width of an image in CSS

关于css - 响应图像行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32756648/

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