我的 Logo 图像在移动设备上看起来像这样:
我希望它自动变小,所以我添加了这个 css:
img {
display: inline-block;
height: auto;
max-width: 100%;
<div class="container">
<div class="row">
<div class="col-lg-12 text-center img-responsive">
<img src="http://placehold.it/600x140" alt="logo" style="margin-bottom: 30px;" />
</div>
但是它不起作用,有人可以帮助我吗?
最佳答案
如果你想让你的图像通过 bootstrap 响应,你必须直接在图像中应用类
<img class="img-responsive" src="http://placehold.it/600x140" alt="logo" style="margin-bottom: 30px;" />
关于css - 响应式 Bootstrap Logo 图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29741340/