• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 911
  • Last Modified:

Redefinition of css class

Hi all
I am finding that when I redefine class in css, FireFox is not enforcing the new style change. In IE the redefinition works fine. The attached code shows the new styles I would like to implement. This re-definition takes place in the aspx code, with a server side script determinig if the alternate css is necessary. Is there any reason why firefox does not want to run these changes ?
#xhl_header_logo {
			        display:none;
		        }
 
    		    .xhl_header_logo {
			        display:none;
		        }
 
		        #xhl_header_AgentLogo {
			       display:none;
		        }
		        .xhl_header_AgentLogo {
			       display:none;
		        }

Open in new window

0
simshp
Asked:
simshp
  • 3
  • 2
1 Solution
 
trickyidiotCommented:
This is NOT redefining:
#xhl_header_logo {
    display:none;
}
.xhl_header_logo {
    display:none;
}


This IS Redefining:

#xhl_header_logo {
    display:none;
}
#xhl_header_logo {
    display:none;
}
0
 
scrathcyboyCommented:
"Is there any reason why firefox does not want to run these changes ?"

It is almost certainly to do with WHERE the ASPX code is placing the CSS -- if you display the page and do View -> source in IE, or view -> page source in FF2-3, you can determine where the CSS is being placed by ASPX.  

You can solve this simply by putting the BASIC framework code into an includes .CSS file, and either put the latest CSS in the head (but make sure the ASPX is not putting the included CSS file AFTER the head CSS -- or if worst comes to worst, put the final CSS inline -- at least to test -- and both browsers will render it fine.
0
 
simshpAuthor Commented:
Could it be that its because I am calling the css file as follows:
<link type="text/css" rel="stylesheet" href="/s/dynamic/header.ascx.css.aspx" />

Would this make firefox unhappy ?

If that is the case how does one create dynamic css based on runtime criteria /

thanks
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
scrathcyboyCommented:
"Would this make firefox unhappy ?"

Definitely yes.

"If that is the case how does one create dynamic css based on runtime criteria /"

<link type="text/css" rel="stylesheet" href="s/dynamic/header.ascx.css" />

Note, I removed the leading slash, it is not desired when the directory "s" is under the public_html folder.
Also, the CSS file has to be called .css extension.  MS might like aspx file extensions, but other browsers are NOT going to load it as a CSS file unless it has a CSS extension, and has NO markup in the file except CSS statements.   Note this last point carefully.
0
 
simshpAuthor Commented:
Ok I managed to get this fix by inserting the attached code into the code behind on the dynamicaly created page.
        Response.ContentType = ("text/css");
        Response.Clear();
        Response.BufferOutput = true;

Open in new window

0
 
scrathcyboyCommented:
so just adding content-type= text/css did it?
 I am surprised this would work with an .ASPX extension -- maybe firefox is more flexible than it used to be.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now