Click here to get back home

DIV not recognized by Firefox - It works only in IE - How to replace it for Firefox?

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
DIV not recognized by Firefox - It works only in IE - How to replace it for Firefox? Wladimir Borsov 05-08-2007
Get Chitika Premium
Posted by Wladimir Borsov on May 8, 2007, 5:13 pm
Please log in for more thread options


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


Posted by Ben C on May 8, 2007, 5:35 pm
Please log in for more thread options


> 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?

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.

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

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">

Posted by ASM on May 8, 2007, 5:39 pm
Please log in for more thread options


Wladimir Borsov a écrit :
> 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.

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

> Is DIV really a pure IE extension?

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 ... :-(

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

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

Posted by Evertjan. on May 8, 2007, 6:10 pm
Please log in for more thread options


Wladimir Borsov wrote on 08 mei 2007 in comp.lang.javascript:

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

"code like" so it is not the code?


> ----
> <!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; top: 0; left: 255px;
> width: 700px; z-index:-1; background-color: transparency;"> Blah blah

background-color: transparent;



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

Posted by =?iso-8859-1?q?Vicente_Ra=FAl_ on May 8, 2007, 6:54 pm
Please log in for more thread options


On May 8, 4:13 pm, wladim...@gmx.net (Wladimir Borsov) wrote:
> 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

Of course divs work in Firefox, but I think transparency don't. Have
you tried using a transparent GIF as the div background image?


Similar ThreadsPosted
Works in IE, Firefox but not on Safari September 8, 2006, 8:29 pm
Website works in Firefox not in IE... October 1, 2007, 8:26 pm
firefox refuses to show a website that works on other machines July 14, 2005, 9:42 pm
  works in internet explorer but problem using in firefox 1.0.4 August 14, 2006, 11:17 am
Firefox and IE are different June 20, 2005, 3:28 am
Why does Firefox use 47 MB of RAM? December 26, 2005, 6:28 am
Firefox bug? April 1, 2008, 9:01 am
Firefox floating bug? November 18, 2004, 4:07 pm
Firefox Fanpage December 5, 2005, 4:50 pm
a img underline - firefox bug?? March 21, 2006, 11:29 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap