覆盖和重置CSS样式:auto或none不工作 [英] Override and reset CSS style: auto or none don't work
问题描述
我要覆写为所有表格定义的CSS样式:
I would like to override following CSS styling defined for all tables:
table {
font-size: 12px;
width: 100%;
min-width: 400px;
display:inline-table;
}
我有一个名为
。
最后表格装饰应如下所示:
I have specific table with class called 'other'
.
Finally table decoration should looks like:
table.other {
font-size: 12px;
}
所以我需要删除3个属性: code>,
min-width
和显示
so i need remove 3 properties: width
,min-width
and display
我尝试用 none
或 auto
重置,但没有帮助,我的意思是这些情况: p>
I tried to reset with none
or auto
, but didn't help, I mean these cases:
table.other {
width: auto;
min-width: auto;
display:auto;
}
table.other {
width: none;
min-width: none;
display:none;
}
推荐答案
第一组属性不起作用是因为 <$的值没有 auto
c $ c> display ,因此应忽略该属性。在这种情况下, inline-table
将仍然生效, width
不适用于 inline
元素,那组属性不会做任何事情。
I believe the reason why the first set of properties will not work is because there is no auto
value for display
, so that property should be ignored. In that case, inline-table
will still take effect, and as width
do not apply to inline
elements, that set of properties will not do anything.
第二组属性将简单地隐藏表,因为 display:none
用于。
The second set of properties will simply hide the table, as that's what display: none
is for.
请尝试将其重设为表
:
table.other {
width: auto;
min-width: 0;
display: table;
}
修改: min-width
默认为 0
,而不是 auto
这篇关于覆盖和重置CSS样式:auto或none不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!