bar*_*ard 4 html css firefox internet-explorer css-tables
我应该使用div构建它,但我必须使用table作为我的客户端(虚拟用户).因此,我使用CSS构建这个html表,这在Chrome中非常完美.
我已经阅读了一些相关的主题,但只是没有得到关键技巧!希望有人告诉我错误.
这里是我的CSS和我在这里的jsfiddle演示(仅适用于Chrome浏览器),请首先检查在Chrome中的jsfiddle演示,然后尝试使用Firefox,你明白我的意思.
#content_container {
width:960px;
}
#content_container .fullcontainer > table {
border-bottom: 4px solid #222;
}
#content_container .fullcontainer {
width:inherit !important;
margin: 0 auto !important;
padding: inherit !important;
}
#content_container table.eurostyle {
margin: 25px auto !important;
border-collapse: collapse !important;
font-family: Gotham, "Helvetica Neue", Helvetica, Arial, sans-serif !important;
text-shadow: 1px 1px 1px #eee;
}
table td img.alignleft {
margin: 0;
}
body h2 {
font-family: Gotham, "Helvetica Neue", Helvetica, Arial, sans-serif !important;
font-weight: bold;
}
.eachtop {
border-top: 4px solid #222;
border-color: #000;
}
.eachaside {
border-top: 1px solid #222;
border-top: 1px solid #ccc;
font-size: 12px;
}
table td {
}
table h2 {
margin: 2px 0;
line-height: 1.1em;
font-size: 22px;
}
.eachtop > td:first-child {
/*height: 40px;*/
padding: 3px 0;
}
.tdfit {
padding: 0 0 0 1px;
line-height: 0;
}
.ctable {
margin: 0 0 0 0px;
}
.ctable td img, .tdfit img {
max-width: 100%;
height: auto;
}
.ctable td {
padding: 1px;
border: 1px solid #000000;
border-top: none;
border-bottom: none;
line-height: 0.9;
}
.ctable td img {
}
Run Code Online (Sandbox Code Playgroud)
Wha*_*ied 14
添加table-layout: fixed
到您的表格,您的问题将得到解决.
来自CSS-Tricks:
在物业/价值到位的情况下,事情变得更加坚固和可预测.布局基于第一行固定.设置其宽度,表格的其余部分如下.
这意味着,而不是确定宽度的表的内容,表的第一行上的样式现在将确定下面其余行的宽度,这使得布局更多,你猜对了,修复了!
工作示例(经过测试的Firefox):
http://jsfiddle.net/gt5t01ov/2/
归档时间: |
|
查看次数: |
6641 次 |
最近记录: |