DIV无法被Firefox识别 - 它仅适用于IE - 如何替换Firefox? [英] DIV not recognized by Firefox - It works only in IE - How to replace it for Firefox?

查看:56
本文介绍了DIV无法被Firefox识别 - 它仅适用于IE - 如何替换Firefox?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的某个网页的HTML源代码简化为以下代码:


----

<!DOCTYPE HTML PUBLIC" ; - // W3C // DTD HTML 4.01 Transitional // EN">

.....

< BODY BACKGROUND =" images / myback.gif" ;>

< div id =" content" style =" position:absolute;顶部:0;左:255px;宽度:700px;的z-index:-1; background-color:transparency;">

Blah blah blah

< / DIV>

< / BODY>

----

该页面在InternetExplorer中正确显示,但不在Firefox中显示。

DIV真的是纯粹的IE扩展吗? br />

如何为Firefox嵌入类似的代码?


弗拉迪米尔

The HTML source of one of my web pages starts simplified with a code like:

----
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
.....
<BODY BACKGROUND="images/myback.gif">
<div id="content" style="position: absolute; top: 0; left: 255px; width: 700px; z-index:-1; background-color: transparency;">
Blah blah blah
</DIV>
</BODY>
----

The page is displayed correctly in InternetExplorer but NOT in Firefox.
Is DIV really a pure IE extension?

How can I embed a similar code for Firefox as well ?

Wladimir

推荐答案

2007-05-08,Wladimir Borsov< wl ******* @ gmx.netwrote:
On 2007-05-08, Wladimir Borsov <wl*******@gmx.netwrote:

我的一个网页的HTML源代码简化为以下代码:


----
<!DOCTYPE HTML PUBLIC" - // W3C / / DTD HTML 4.01 Transitional // EN">

....
< BODY BACKGROUND =" images / myback.gif">
< div id = QUOT;内容" style =" position:absolute;顶部:0;左:255px;宽度:700px;的z-index:-1; background-color:透明度;">

Blah blah blah
< / DIV>
< / BODY>

--- -


页面在InternetExplorer中正确显示,但不在Firefox中显示。

DIV真的是纯粹的IE扩展吗?
The HTML source of one of my web pages starts simplified with a code like:

----
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
....
<BODY BACKGROUND="images/myback.gif">
<div id="content" style="position: absolute; top: 0; left: 255px; width: 700px; z-index:-1; background-color: transparency;">
Blah blah blah
</DIV>
</BODY>
----

The page is displayed correctly in InternetExplorer but NOT in Firefox.
Is DIV really a pure IE extension?



问题不在于DIV,而在于z-index:-1,这应该把

div放在各种各样的东西背后但不落后根元素。


但是哪个元素完全是根元素? HTML或#document?甚至

给出HTML和BODY背景:透明(顺便说一句是

正确的值,而不是透明度)并不会使文本在FF中可见。

The problem is not with DIV but with z-index: -1, which should put the
div behind various things but not behind the root element.

But which element is the root element exactly? HTML or #document? Even
giving HTML and BODY background: transparent (which by the way is the
correct value, not "transparency") doesn''t make the text visible in FF.


如何为Firefox嵌入类似的代码?
How can I embed a similar code for Firefox as well ?



添加''style =" position:relative; z-index:0;到BODY。这将使它成为div的堆叠上下文并避免依赖根堆叠

上下文。


Don''使用Transitional doctype,总是使用严格的doctype:


<!DOCTYPE HTML PUBLIC" - // W3C // DTD HTML 4.01 // EN" http://www.w3.org/TR/REC-html40/strict.dtd">

Add ''style="position: relative; z-index: 0;"'' to BODY. That will make it
the stacking context for the div and avoid relying on the root stacking
context.

Don''t use the Transitional doctype, always use the strict one:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">


Wladimir Borsovaécrit:
Wladimir Borsov a écrit :

我的一个网页的HTML源代码简化为以下代码:


----

<!DOCTYPE HTML PUBLIC" - // W3C // DTD HTML 4.01 Transitional // EN">

....

< BODY BACKGROUND =" ; images / myback.gif">

< div id =" content" style =" position:absolute;顶部:0;左:255px;宽度:700px;的z-index:-1; background-color:transparency;">

Blah blah blah

< / DIV>

< / BODY>

----

该页面在InternetExplorer中正确显示,但不在Firefox中显示。
The HTML source of one of my web pages starts simplified with a code like:

----
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
....
<BODY BACKGROUND="images/myback.gif">
<div id="content" style="position: absolute; top: 0; left: 255px; width: 700px; z-index:-1; background-color: transparency;">
Blah blah blah
</DIV>
</BODY>
----

The page is displayed correctly in InternetExplorer but NOT in Firefox.



正确是什么意思? ?

IE显示什么?

What do you mean by "correctly" ?
What does IE display ?


DIV真的是纯粹的IE扩展吗?
Is DIV really a pure IE extension?



使用z-index:-1;作为你独特的div的风格

这个显示在底层

(屏幕下方或屏幕后方或文件的正文,如你所愿)

so ...要看的东西...... :-(

With z-index: -1; as style of your unique div
this one is displayed in ground-floor
(bellow or behind the screen or the document''s body, as you want)
so ... anything to see ... :-(


如何为Firefox嵌入类似的代码?
How can I embed a similar code for Firefox as well ?



给你的div一个正确的z-index ...(> = 0)

Nota:颜色''transparentcy''没有'不存在,它''透明''

,默认背景颜色是透明的。


-

Stephane Moriaux et son(moins)vieuxMacdéjàdépassé

Stephane Moriaux和他的(旧)Mac已经过时

Give to your div a correct z-index ... ( >= 0 )
Nota : the color ''transparentcy'' doesn''t exist, it is ''transparent''
and default background color is transparent.

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date


Wladimir Borsov在08上写道mei 2007 in comp.lang.javascript
Wladimir Borsov wrote on 08 mei 2007 in comp.lang.javascript:

我的一个网页的HTML源代码开始使用代码简化

喜欢:
The HTML source of one of my web pages starts simplified with a code
like:



" code likeso so so它不是代码吗?

"code like" so it is not the code?


----

<!DOCTYPE HTML PUBLIC" - // W3C // DTD HTML 4.01 Transitional // EN">

....

< BODY BACKGROUND =" images / myback.gif">
----
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
....
<BODY BACKGROUND="images/myback.gif">



< body style =''background-image:url(" images / myback.gif");''>


< div id =" content" style =" position:absolute;顶部:0;左:255px;

宽度:700px;的z-index:-1; background-color:transparency;" Blah blah
<div id="content" style="position: absolute; top: 0; left: 255px;
width: 700px; z-index:-1; background-color: transparency;"Blah blah



background-color:transparent;


-

Evertjan。

荷兰。

(请在我的电子邮件地址中将x'变为点数)

background-color: transparent;

--
Evertjan.
The Netherlands.
(Please change the x''es to dots in my emailaddress)

这篇关于DIV无法被Firefox识别 - 它仅适用于IE - 如何替换Firefox?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆