css - 响应式 Bootstrap Logo 图像

标签 css twitter-bootstrap responsive-design

我的 Logo 图像在移动设备上看起来像这样:

enter image description here

我希望它自动变小,所以我添加了这个 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/

相关文章:

html - bootstrap 4 列似乎挡住了其余列以占据整行

javascript - 使用 jquery/css 垂直对齐无衬线字体

javascript - 如何使用 Bootstrap 模式检查先决条件?

html - 响应图像,固定比例。无法让代码工作

具有三列的 HTML/CSS 全宽标题 - 2 固定 1 松散

html - 响应式布局 : How to switch positions in smartphone layout

javascript - 站点如何立即检测到 javascript 已被禁用?

html - 通过用 css 悬停另一个 div 来显示一个用表单 Action 包裹的 div

html - 如何使用粘性顶部导航、侧边栏和页脚开发 Bootstrap 布局

javascript - 单击面板外部不会关闭选择框