Javascript 滑块的高度取决于屏幕的宽度

Javascript 滑块的高度取决于屏幕的宽度,javascript,twitter-bootstrap,twitter-bootstrap-3,Javascript,Twitter Bootstrap,Twitter Bootstrap 3,我只使用了Bootstrap3,效果很好 我想喜欢:即图像的高度降低到寄存器主菜单的宽度 我如何才能做到这一点?直接从 CSS: img { /* Remove border when inside `a` element in IE 8/9. */ border: 0; /* Improve image quality when scaled in IE 7. */ -ms-interpolation-mode: bicubic; /* Suppress the spac

我只使用了Bootstrap3,效果很好

我想喜欢:即图像的高度降低到寄存器主菜单的宽度

我如何才能做到这一点?

直接从

CSS:

img {
  /* Remove border when inside `a` element in IE 8/9. */
  border: 0;
  /* Improve image quality when scaled in IE 7. */
  -ms-interpolation-mode: bicubic;

  /* Suppress the space beneath the baseline */
  /* vertical-align: bottom; */

  /* Responsive images */
  max-width: 100%;
  height: auto;
  /* Correct IE 8 not scaling image height when resized. */
  width: auto;
  width: auto\9;
}

对不起,我不太明白你的答案。我必须在我的类中添加此代码。carousel internal>.item>img?是的,但我建议您按原样添加此代码,以便每个图像都能响应并根据浏览器大小的更改进行调整。如果您不希望其他图像正确缩放,请将我的
img{
替换为您的
.carousel内部img{
根据您认为适合您的情况,它不起作用。根据浏览器宽度,高度始终为500 px。如果希望按比例缩放,则必须删除
高度
属性。好的,但如果我删除,图像将不再显示!