Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 图像不';当网格最小化时,不适合网格_Css_Twitter Bootstrap - Fatal编程技术网

Css 图像不';当网格最小化时,不适合网格

Css 图像不';当网格最小化时,不适合网格,css,twitter-bootstrap,Css,Twitter Bootstrap,当我看到分辨率为sm和xs的设备时,我的图像有空间,如何使其与网格相匹配 这是我的密码 <div class="container"> <div class="row"> <div class="col-md-7"> <img src="http://placehold.it/550x350" class="img-responsive"> </div> <div class="col-md-5">

当我看到分辨率为
sm
xs
的设备时,我的图像有空间,如何使其与网格相匹配

这是我的密码

<div class="container">
    <div class="row">
  <div class="col-md-7">
    <img src="http://placehold.it/550x350" class="img-responsive">
  </div>
  <div class="col-md-5">
    <h2>How do you auto-resize a large image so that it will fit into a smaller width div container whilst maintaining it's width:height ratio?</h2>
    <p>How do you auto-resize a large image so that it will fit into a smaller width div container whilst maintaining it's width:height ratio?</p>
  </div>
</div>
</div>

如何自动调整大图像的大小,使其适合较小的宽度div容器,同时保持其宽高比?
如何自动调整大图像的大小,使其适合较小的宽度div容器,同时保持其宽高比

从分辨率
991px到581px
我从图像中获得了空白(好像它不适合网格)


如何修复它?

我只需添加
宽度:100%到您的图像中

我只需添加
宽度:100%到您的图像

可能是您的解决方案代码:

<div class="container-fluid">

  <div class="row">
    <div class="col-md-7">
      <img src="http://placehold.it/550x350" class="img-responsive" style="width:100%" alt="Image">
    </div>
    <div class="col-md-5">
      <h2>How do you auto-resize a large image so that it will fit into a smaller width div container whilst maintaining it's width:height ratio?</h2>
    <p>How do you auto-resize a large image so that it will fit into a smaller width div container whilst maintaining it's width:height ratio?</p>
    </div>
  </div>
</div>

如何自动调整大图像的大小,使其适合较小的宽度div容器,同时保持其宽高比?
如何自动调整大图像的大小,使其适合较小的宽度div容器,同时保持其宽高比


可能是您的解决方案代码:

<div class="container-fluid">

  <div class="row">
    <div class="col-md-7">
      <img src="http://placehold.it/550x350" class="img-responsive" style="width:100%" alt="Image">
    </div>
    <div class="col-md-5">
      <h2>How do you auto-resize a large image so that it will fit into a smaller width div container whilst maintaining it's width:height ratio?</h2>
    <p>How do you auto-resize a large image so that it will fit into a smaller width div container whilst maintaining it's width:height ratio?</p>
    </div>
  </div>
</div>

如何自动调整大图像的大小,使其适合较小的宽度div容器,同时保持其宽高比?
如何自动调整大图像的大小,使其适合较小的宽度div容器,同时保持其宽高比


对于
sm
xs
屏幕,您没有使用引导
,请使用它,并将
img
max width
更改为
width

 img{
    width :100%;
 }

<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-7">
  <img src="http://placehold.it/550x350" class="img-responsive">
</div>
<div class="col-xs-12 col-sm-12 col-md-5">
  <h2>How do you auto-resize a large image so that it will fit into a smaller width div container whilst maintaining it's width:height ratio?</h2>
  <p>How do you auto-resize a large image so that it will fit into a smaller width div container whilst maintaining it's width:height ratio?</p>
</div>
img{
宽度:100%;
}
如何自动调整大图像的大小,使其适合较小的宽度div容器,同时保持其宽高比?
如何自动调整大图像的大小,使其适合较小的宽度div容器,同时保持其宽高比


您没有为
sm
xs
屏幕使用引导
,请使用该选项,并将
img
max width
更改为
width

 img{
    width :100%;
 }

<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-7">
  <img src="http://placehold.it/550x350" class="img-responsive">
</div>
<div class="col-xs-12 col-sm-12 col-md-5">
  <h2>How do you auto-resize a large image so that it will fit into a smaller width div container whilst maintaining it's width:height ratio?</h2>
  <p>How do you auto-resize a large image so that it will fit into a smaller width div container whilst maintaining it's width:height ratio?</p>
</div>
img{
宽度:100%;
}
如何自动调整大图像的大小,使其适合较小的宽度div容器,同时保持其宽高比?
如何自动调整大图像的大小,使其适合较小的宽度div容器,同时保持其宽高比

尝试添加自定义样式

尝试像这样添加自定义样式

?这样地?