图像流体在 Bootstrap 4 上不起作用

焦富斯

我在使用 Bootstrap 4 制作响应式图像时遇到问题?当下面的代码呈现给浏览器时,导航栏(左上角)中有三个图像。在移动设备上查看时,这三个图像的尺寸缩小时出现问题!

我希望导航栏中的两列并排放置,图像缩小,文本向右对齐。此时,两列不会并排放置,因为图像没有响应,因此第二列被强制置于下方?

我有一个更大的旋转木马,这似乎工作正常!我不确定为什么这有效而其他图像无效?我可能在这里做了一些非常愚蠢的事情,但我会很感激有人强调我哪里出错了,以免我拔掉头发。提前致谢

<html>
<head>
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
    integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">

    <style type="text/css">
      .contact {
        text-align: right;
      }
    </style>
</head>
<body>
  <div class="container-fluid">
    <nav class="navbar px-0">
      <div class="row col-lg-12 px-0">
        <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6 no-right-padding">
          <img class="img-fluid" src="http://via.placeholder.com/160x40" alt=""><img class="img-fluid" src="http://via.placeholder.com/160x40" alt="">
          <br>
          <a class="navbar-brand" href="index.html">
            <img class="img-fluid" src="http://via.placeholder.com/160x160" style="margin-top: 10px;" alt="">
          </a>
        </div>
        <div class="contact col-lg-6 col-md-6 col-sm-6 col-xs-6 px-0">
          <p><a href="contact.html">Some heading</a></p>
          <div style="padding-top: 30px;">
            <p>Some random text
          </div>
        </div>
      </div>
    </nav>

    <div class="col-lg-12 px-0 carousel slide carousel-fade animated fadeIn" id="carousel" data-ride="carousel">
        <div class="carousel-inner">
          <div class="carousel-item active">
            <img class="img-fluid" src="http://via.placeholder.com/1736x890" alt="First slide">
          </div>
          <div class="carousel-item">
            <img class="img-fluid" src="http://via.placeholder.com/1736x890" alt="Second slide">
          </div>
          <div class="carousel-item">
            <img class="img-fluid" src="http://via.placeholder.com/1736x890" alt="Third slide">
          </div>
        </div>
      </div>
  </div>

  <!-- bootstrap 4 js & jQuery -->
    <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>

</body>
ashfaq.p

问题在于引导程序类的使用。

col-xs-6bootstrap 4 中没有now。它的col-6

这里是工作plunker:并排列

我也col-lg-12<div class="row col-lg-12 px-0">

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章