html - Bootstrap Carousel,选择高度

标签 html css twitter-bootstrap-3 carousel

我正在尝试在 bootstrap 中设置轮播的高度。如果我将高度设置为 700px,旋转木马在响应中看起来像垃圾。那么我该如何解决这个问题,使我的轮播在桌面和智能手机等设备上看起来不错?合适的高度应该是多少?

最佳答案

您可以尝试使用vh 和vw 来获取视口(viewport)的高度和宽度

.class{ 
  width: 50vw; 
  height: 50vh;       
}

With vw/vh, we can size elements to be relative to the size of the viewport. The vw/vh units are interesting in that 1 unit reflects 1/100th the width of the viewport. To make an element the full width of the viewport, for example, you'd set it to width:100vw.

更多信息 refer 这个链接

1vw = 视口(viewport)宽度的 1%
1vh = 视口(viewport)高度的 1%
1vmin = 1vw 或 1vh,取小者
1vmax = 1vw 或 1vh,取大者

关于html - Bootstrap Carousel,选择高度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32863599/

相关文章:

javascript - 如何在可扩展菜单中正确显示标题?

html - 如何在同一模态中打开和关闭另一个模态?

css - 使用 bootstrap 的垂直主菜单的水平子菜单

jquery - 如何交换 div 之间的内容,以便将 div 1 中的内容插入到 div 2 中,反之亦然

javascript - FullCalendar v4.2.0 destroy() 不工作

html - 在CSS中创建幻灯片菜单

css - 如何在 Bootstrap 3 中将最大宽度应用于带有尾随辅助按钮的输入字段表单控件?

javascript - 输入文本字段到 td

将自定义选择的 CSS 集成到网站中

css - 修改导航栏时,如何正确呈现下拉菜单?