小编WeC*_*Lot的帖子

为什么 Bootstrap 4 中的 img-fluid 类没有在其 div 中调整我的图像大小?

我在这里有一个 Bootply 游乐场示例:https ://www.bootply.com/eXlkXkUvDJ

我正在尝试对齐底部的三个图像,以便最左侧和最右侧的图像与主图像和标题齐平。我还希望图像完全填充 div——我用黑色突出显示了第一个图像 div,这样您就可以看到图像没有完全填充它。

我检查了 Bootstrap 4 文档,看起来 'img-fluid' 类应该使图像填充每个 div,但这并没有发生。

这是我的 HTML 代码:

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Aisha Wells Portfolio</title>
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="main.css">
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
<div class="container" alt="this is the main container">
    <div class="row">
        <div class="col-md-6" alt="udacity logo">
            <img src="http://cdn.onlinewebfonts.com/svg/img_369247.png" alt="fake logo" width="50" height="50" class="img-responsive">
        </div>
        <div class="col-md-6 text-right text-uppercase" alt="my name">
                <h1> Shere Wells </h1>

                <h3> Writer and Filmmaker </h3>

        </div>
    </div>
</div>
<div class="container" …
Run Code Online (Sandbox Code Playgroud)

css twitter-bootstrap

5
推荐指数
1
解决办法
6074
查看次数

标签 统计

css ×1

twitter-bootstrap ×1