Forum Moderators: open

Message Too Old, No Replies

HTML DOCTYPE and problem with background-image

         

silverbytes

7:21 pm on Feb 15, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have some pages using

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

tables and layers including images to make background effects like this:

.cellbackmenuover {
background-image:url(fotos/navbut_over.gif);
background-repeat:no-repeat;
background-position:left bottom;
width:95px;
height:46px;
}

Added a pure css menu and it's not working properly.

Instead if I change the page starting with:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

The css menu works but my backgrounds are gone.
I guess -but can't fix- perhaps those background-image:url(fotos/navbut_over.gif);background-repeat:no-repeat; are not supported...

What can I modify to make both live together in the page (css menu and background images for tables)?

encyclo

8:52 pm on Feb 15, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I can't reproduce the problem with the example you gave, unfortunately. The syntax is certainly valid, and it functions as expected in a simple test case.

There are some differences in the handling of background colors between quirks and standards mode, however, and I expect it to be related to inheritance of a background color from another element when in quirks mode. What does your HTML look like?

silverbytes

9:47 pm on Feb 15, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks. Sent you a test url (sticky) you will not see the backgrounds properly as it is (but you may guess something is missing because looks odd) but you have the code there

menu.css is the css for top menu
and styles.css contains the background styles