Forum Moderators: not2easy

Message Too Old, No Replies

CSS Background Lost after index page on FF

Firefox only issue with CSS

         

Aario

11:01 am on Dec 23, 2009 (gmt 0)

10+ Year Member



With all browsers... Opera, Safari, Chrome and IE my css reloads after the first page, even if it goes to a copy of the same css but renamed, it loads. When I try to get past the index part of my website, the css does not load the background image, only the background color.

Below are samples of my code which has all be W3C validated:

Common.css:

body {
color: #000000;
margin: 10px;
padding: 0px;
background-attachment: fixed;
background-position: top left;
background-repeat: repeat;
background-color: #F5F3E7;
font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
font-size: 11px;
background-image: url(http://www.website.com/images/main_background.jpg);
}

-------------------------

Non-index page:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Website Name</title>
<link rel="stylesheet" href="http://www.website.com/stylesheets/common.css" type="text/css" media="all" />
<style type="text/css" media="all">@import url "http://www.website.com/stylesheets/common.css";</style>
<meta http-equiv="ImageToolbar" content="No" />
<meta name="MSSmartTagsPreventParsing" content="True" />
<meta http-equiv="Content-Language" content="en-us" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<p align="center"><img title="" alt="" width="741" height="58" src="/images/main_title.png" /></p>
<p align="center"><img title="" alt="" width="314" height="39" src="/images/menu_titles/sub_title.png" /></p>
<p align="center">(Small Text Description for Sub-Title)</p>
<p align="center">&nbsp;</p>
<p align="center">&nbsp;</p>
<p align="left"><a href="menu_link-1.php"><img title= "" alt="" width="141" height="20" src="/images/menu_titles/menu_pic-1.png" /></a><br />(Back to the Homepage)</p>
<p align="left"><a href="menu_link-2.php"><img title= "" alt="" width="134" height="20" src="/images/menu_titles/menu_pic-2.png" /></a><br />(Safe)</p>
<p align="left"><a href="menu_link-3.php"><img title= "" alt="" width="199" height="20" src="/images/menu_titles/menu_pic-3.png" /></a><br />(Healthy)</p>
<p align="left"><a href="menu_link-4.php"><img title= "" alt="" width="198" height="20" src="/images/menu_titles/menu_pic-4.png" /></a><br />(The Forums)</p>
<p align="left"><a href="menu_link-5.php"><img title= "" alt="" width="171" height="20" src="/images/menu_titles/menu_pic-5.png" /></a><br />(Gallery of Items)</p>
<p align="left"><a href="menu_link-6.php"><img title= "" alt="" width="208" height="20" src="/images/menu_titles/menu_pic-6.png" /></a><br />(Laws by States for Items)</p>
<p align="left"><a href="menu_link-7.php"><img title= "" alt="" width="200" height="20" src="/images/menu_titles/menu_pic-7.png" /></a><br />(Wonderful Sounds of Non-Silence)</p>
<p align="left"><a href="menu_link-8.php"><img title= "" alt="" width="171" height="20" src="/images/menu_titles/menu_pic-8.png" /></a><br />(Shopping Time)</p>
<p align="left"><a href="menu_link-9.php"><img title= "" alt="" width="130" height="20" src="/images/menu_titles/menu_pic-9.png" /></a><br />(Links to Other Sites)</p>
</body>
</html>

------------------------------------------------

Only link names, image names and site names changed but the code is the same. As stated earlier, in Firefox 3.5.6 only, the index page shows the background, but any other page after that, from a link, will not.

Any clues? This was also duplicated in FF on Fedora and Ubuntu.

Aario

11:10 am on Dec 23, 2009 (gmt 0)

10+ Year Member



The only difference between the page displayed up top and the index page is the meta link for keywords for crawlers.

CSS_Kidd

2:09 pm on Dec 23, 2009 (gmt 0)

10+ Year Member




<link rel="stylesheet" href="http://www.website.com/stylesheets/common.css" type="text/css" media="all" />
<style type="text/css" media="all">@import url "http://www.website.com/stylesheets/common.css";</style>

Why are you linking and importing the same stylesheet? Also on your imported one, you need to state it as such:

<style type="text/css">
@import url("http://www.website.com/stylesheets/common.css");
</style>

Aario

5:09 pm on Dec 23, 2009 (gmt 0)

10+ Year Member



Took out the <link rel= and made the changes you suggested and got the same negative results.

I even took one of the files in question and renamed it to the index and received the same results. The only difference I can see between the index and the files in question is a src= call that goes to a file name 19.3 chars long.

I will work with that idea.

Aario

5:34 pm on Dec 23, 2009 (gmt 0)

10+ Year Member



Ok, shortening the file names did not work. Nor did putting everything in the same location as the index file. I did notice the background color came through but not the background image laid out in the css.

CSS_Kidd

5:49 pm on Dec 23, 2009 (gmt 0)

10+ Year Member



is your directory set up as such:
Root(www.website.com)
---images (folder)
---stylesheets(folder)
---index.htm

If so you don't need to have the full site address for the link to the stylesheet. Do this instead:

<link rel="stylesheet" type="text/css" href="stylesheets/common.css" />

use the same url for import if that is the method of choice.

Probably wont solve the problem but is something that needed to be addressed.

Aario

5:55 pm on Dec 23, 2009 (gmt 0)

10+ Year Member



Yes, setup exactly like that. I originally had it set to stylesheets/common.css but went a bit more drastic when things were not working out under FF.

Aario

7:21 am on Dec 24, 2009 (gmt 0)

10+ Year Member



-- Solution --

The index page was the only page that worked. Took that page and renamed it, removed the crawler reference and threw in the code from the other pages and uploaded it. That ended up working. I still am befuddled as to what was broken, but not questioning it. Onward to more code.

Thx for your help.