移动 Safari 中的表格错误
我有下表:
<table cellpadding="0" cellspacing="0" width="100%" style="border-collapse:collapse">
<tr>
<td class="tr-l-t">
</td>
<td class="tr-t">
</td>
<td class="tr-r-t">
</td>
</tr>
<tr>
<td class="tr-l">
</td>
<td class="control-panel">
</td>
<td class="tr-r">
</td>
</tr>
<tr>
<td class="tr-l-b">
</td>
<td class="tr-b">
</td>
<td class="tr-r-b">
</td>
</tr>
...和 CSS
.tr-l-t
{
background: url("../Images/tr_l_t.png") no-repeat;
width: 6px;
height: 6px;
}
.tr-l-b
{
background: url("../Images/tr_l_b.png") no-repeat;
width: 6px;
height: 6px;
}
.tr-r-t
{
background: url("../Images/tr_r_t.png") no-repeat;
width: 6px;
height: 6px;
}
.tr-r-b
{
background: url("../Images/tr_r_b.png") no-repeat;
width: 6px;
height: 6px;
}
.tr-t
{
background: transparent url("../Images/tr_t.png") repeat scroll 0 0;
height: 6px;
}
.tr-l
{
background: transparent url("../Images/tr_l.png") repeat scroll 0 0;
}
.tr-r
{
background: transparent url("../Images/tr_r.png") repeat scroll 0 0;
}
.tr-b
{
background: transparent url("../Images/tr_b.png") repeat scroll 0 0;
height: 6px;
}
.control-panel
{
background-color: #151515;
width: 300px;
height: 30px;
}
两者在 IE7/8、FF、Chrome 和 Safari(Windows 和 Mac OS)浏览器中看起来都很好。但是,在 Ipod / Iphone / Ipad 的 Safari 中,td 标签之间会出现白色条纹。我尝试添加 border:0 none、padding:0px、margin: 0px,但没有成功。
您对如何修复它有什么想法吗?
I have the following table:
<table cellpadding="0" cellspacing="0" width="100%" style="border-collapse:collapse">
<tr>
<td class="tr-l-t">
</td>
<td class="tr-t">
</td>
<td class="tr-r-t">
</td>
</tr>
<tr>
<td class="tr-l">
</td>
<td class="control-panel">
</td>
<td class="tr-r">
</td>
</tr>
<tr>
<td class="tr-l-b">
</td>
<td class="tr-b">
</td>
<td class="tr-r-b">
</td>
</tr>
...and CSS
.tr-l-t
{
background: url("../Images/tr_l_t.png") no-repeat;
width: 6px;
height: 6px;
}
.tr-l-b
{
background: url("../Images/tr_l_b.png") no-repeat;
width: 6px;
height: 6px;
}
.tr-r-t
{
background: url("../Images/tr_r_t.png") no-repeat;
width: 6px;
height: 6px;
}
.tr-r-b
{
background: url("../Images/tr_r_b.png") no-repeat;
width: 6px;
height: 6px;
}
.tr-t
{
background: transparent url("../Images/tr_t.png") repeat scroll 0 0;
height: 6px;
}
.tr-l
{
background: transparent url("../Images/tr_l.png") repeat scroll 0 0;
}
.tr-r
{
background: transparent url("../Images/tr_r.png") repeat scroll 0 0;
}
.tr-b
{
background: transparent url("../Images/tr_b.png") repeat scroll 0 0;
height: 6px;
}
.control-panel
{
background-color: #151515;
width: 300px;
height: 30px;
}
Both look good in IE7/8, FF, Chrome and Safari (Windows and Mac OS) browsers. However, in Safari for Ipod / Iphone / Ipad white stripes appear in between td tags. I've tried adding border:0 none, padding:0px, margin: 0px, but with no success.
Do you have any ideas on how to fix it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这对我有用,但就我而言,我用纯白色连接两个 TD。
不确定这是否适用于所有情况。
This worked for me, but in my case I was joining two TDs with a solid white color.
Not sure if this will be usable in every case.
使用页面模板中的元标记设置视口。当比例为“1”时,表格看起来不错。当放大或缩小或者甚至将初始缩放设置为 1 以外的任何值时,您会得到间隙。这就是我目前正在做的事情。
注册,
兆瓦
Set the viewport using a meta tag in the template of the page. When the scale is at "1" the tables apear okay. When zooming in or out OR even setting the initial zoom anything other than 1, you get the gaps. That's what I'm working on at the moment.
reg,
MW