我有一个网站(http://studenter.miun.se/~liha1507/dt100g/data/),我想为移动设备定制,它确实如此,但当您查看智能手机上的页面时,您仍然可以将站点侧移。知道如何解决这个问题的人?
发布于 2017-05-11 18:52:53
您的列上有一些硬编码的宽度样式(HTML中的内联)。
从下面更改您的列的和:
<div class="col-md-6" style="width:815px;">对此:
<div class="col-md-6">发布于 2017-05-11 19:07:52
正确使用引导程序,并将内联样式移除到css中。
在你的html上
<div id="my-div-1" class="col-md-6"></div>
<div id="my-div-2" class="col-md-6"></div>CSS在断点处使用auto,如下所示
#my-div-1 {
width: 815px;
}
#my-div-1 {
width: 335px;
}
@media (max-width: 992px) /* Check what the width is for the breakpoint */
#my-div-1, #my-div-2 {
width: auto;
}
}https://stackoverflow.com/questions/43923342
复制相似问题