我正在使用bootstrap响应式设计,当在iPad中查看我的网页时,它会在右侧产生空白空间,我在viewport元标记中将宽度设置为设备宽度,如何删除空白空间?
我试过this,没有任何效果
答案 0 :(得分:0)
White-space是一个文本字符。只需使用font: 0/0 a;
使文字不可见。
让我解释。常见HTML的两个例子:
<div>
<!--White-space -->
<span>Some text here<span>
</div>
示例1. iPad上有空格(jsfiddle
),css:
div {
background: red;
}
span {
background: blue;
color: #fff;
}
示例2. iPad上没有空格(jsfiddle
),css:
CSS:
div {
background: red;
font: 0/0 a;/*make text invisible for parent container with white-spaces*/
}
span {
background: blue;
color: #fff;
font: 12px/normal Arial, sans-serif;/*set back font for child container*/
display:inline-block;/*just for good render effect*/
}