问题描述
G''day。
是否有已知的display:block;歌剧中的问题?
在试图获得一些跨浏览器的一致性时,我或者无意中或冗余地(取决于你的观点)添加了
" display:block;"定义表格的样式也没有填充,边距
和边框。
使用xdisplay:block; (这没什么)所有的浏览器(好的Ie6,MZ,Ff Op在
Win2k中)都按预期显示了该表。当display:block;时将表格设置为
仅限Opera,在单元格中添加1或2个px边框。
我无法告诉你我需要花多长时间请注意这......实际上我放弃了
歌剧,因为我的代码严重受损,而不是代码中的冗余。
如果我不是非常清楚下面的例子应该显示问题:
(问题只发生在Opera中。)
和display:block;推出xdisplay:block;
关于DM
-------- -------------------------------------------------- ------
David Morris
珀斯西澳大利亚
G''day.
Is there a known "display:block;" problem in opera?
In playing around trying to get some cross browser conformance, I either
inadvertently or redundantly (depending on your perspective) added
"display:block;" to a style defining tables that also had zero padding, margin
and border.
With "xdisplay:block;" (that is nothing) all browsers (well Ie6, MZ, Ff Op in
Win2k) showed the table as expected. When "display:block;" is set the tables in
Opera only, have a 1 or 2 px border added to the cells.
I cannot tell you how long it took me to notice this... in fact I gave up on
opera as being seriously broken, rather than some redundancy in my code.
In case I am not being very clear the examples below should show the problem:
(nb the problem ONLY occurs in Opera.)
http://www.netwiz.com.au/opera/operagood.html
and with display:block; munged out to xdisplay:block;
http://www.netwiz.com.au/opera/operagood.html
regards DM
----------------------------------------------------------------
David Morris
http://www.netwiz.com.au/
Perth Western Australia
推荐答案
如果要将表格元素渲染为一个表然后它应该是
设置为display:table,因为这是默认的,它是多余的。
设置表元素(或tr / td)要显示:block会将
元素更改为例如div。
其他UAs无法正确处理,Opera确实如此。
-
Spartanicus
If you want a table element to be rendered as a table then it should be
set to display:table, since this is the default it''s superfluous.
Setting the table element (or tr/td) to display:block will change the
element to behave like for example a div.
Other UAs don''t handle this correctly, Opera does.
--
Spartanicus
在这种情况下它是superflu无论如何(见)
,但为什么添加边框,当样式将边框设置为0px时,
正确的方法呢?
In this case it was superfluous anyway (see http://www.netwiz.com.au/home.html)
, but why is adding a border, when the style sets the borders to 0px, the
correct way of doing it?
这篇关于显示:Opera中的阻塞问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!