【发布时间】:2018-02-08 21:32:56
【问题描述】:
我有一个使用 Chartist 在一行上显示 4 个条形图的网站。 我正在尝试使用 Bootstrap 的响应式解决方案来显示 4 个图表,一个位于另一个下方,但是当我访问 iphone 6 上的页面时,图表 div 的高度越来越长。奇怪的是,当我修改 Chrome 的窗口大小时浏览器,就像一个魅力。
这是我的网站:http://clipping.primerahora.cl/
这是有问题的html部分:
<div class="container">
<div class="row">
<div style="display:table; margin:0 auto;">
<div id="chart-01" class="col-md-3 ct-chart01 d1" style="display:table; margin:0 auto; width:22%; height:50%; max-height: 50%; margin:5px; background-color: white; font-family: arial; font-stretch: condensed; text-align: center;">Tipo de Prensa</div>
<div id="chart-02" class="col-md-3 ct-chart02 d1" style="display:table; margin:0 auto; width:22%; height:50%; max-height: 50%; margin:5px; background-color: white; font-family: arial; font-stretch: condensed; text-align: center;">Medios mas vistos</div>
<div id="chart-03" class="col-md-3 ct-chart03 d1" style="display:table; margin:0 auto; width:22%; height:50%; max-height: 50%; margin:5px; background-color: white; font-family: arial; font-stretch: condensed; text-align: center;">Regiones</div>
<div id="chart-04" class="col-md-3 ct-chart04 d1" style="display:table; margin:0 auto; width:22%; height:50%; max-height: 50%; margin:5px; background-color: white; font-family: arial; font-stretch: condensed; text-align: center;">Productos</div>
</div>
</div>
</div>
我尝试使用一些媒体查询但没有运气:
@media screen and (min-width: 1024px) {
.d1{
max-height:50%;
height:50%;
}
}
@media screen and (max-width: 800px) {
.d1{
max-height:50%;
height:50%;
}
}
@media screen and (max-width: 600px) {
.d1{
max-height:50%;
height:50%;
}
}
【问题讨论】:
标签: jquery css twitter-bootstrap media-queries chartist.js