如何使用css使图像大小变大?

时间:2016-11-02 14:42:31

标签: html css twitter-bootstrap

我想让图片大小变大但是下面的代码没有发生,我怎么能用css实现这个任务?我是否需要覆盖引导程序?

#logo {
  height: 40px;
}
.navbar-brand>img {
  max-height: 100%;
  height: 100%;
  width: auto;
  margin: 0 auto;
  -o-object-fit: contain;
  object-fit: contain;
}
<a class="navbar-brand">
  <img src="assets/images/logo.png" id="logo">
</a>

1 个答案:

答案 0 :(得分:1)

img.expand { width: 10em; }
<img src="http://keenthemes.com/preview/metronic/theme/assets/global/plugins/jcrop/demos/demo_files/image1.jpg" alt="fruit" class="expand" />

img.expand { width: 50em; }
<img src="http://keenthemes.com/preview/metronic/theme/assets/global/plugins/jcrop/demos/demo_files/image1.jpg" alt="fruit" class="expand" />