<table id="exclude1"><tr><td id="exclude2" height="100%" width="100%">
<div>123</div><table>......</table> etc
</td></tr></table>
和CSS样式
<style>
#exclude1, #exclude2 {border:0; background:transparent; width:100%; height:100%; margin:auto; padding:0; float:none; position:relative;}
* {border:1px solid red; background:red; width:100px; etc.....}
</style>
的问题是,当我设置 '显示:块' 或 '显示:内联' 为“* '选择器是css,那么这种风格也适用于排除选择器。 当我为'exclude'选择器设置'display:block'或'table'或'table-cell'或其他任何东西时,这两个元素会变得不同(对齐,大小等都被破坏了)。
我能做些什么,使#exclude1和#exclude2不受'*'选择器样式的影响?
UPD:
我分开#exclude1,#exclude2为:
#exclude1 {border:0; background:transparent; width:100%; height:100%; margin:auto; padding:0; float:none; position:relative; display:table;}
#exclude2 {border:0; background:transparent; width:100%; height:100%; margin:auto; padding:0; float:none; position:relative; display:table-cell; vertical-align:middle;}
,似乎像所有至少现在工作得很好。 Thanx。
为什么你将这些属性应用于一切?为什么一切都是红色的盒子? – BoltClock
'#exclude1'应该是'display:table','#exclude2'应该是'display:table-cell' –
@BoltClock:这只是一个例子。简化。 –