Link to home
Start Free TrialLog in
Avatar of simshp
simshpFlag for Israel

asked on

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

Avatar of trickyidiot
trickyidiot

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;
}
"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.
Avatar of simshp

ASKER

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
"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.
ASKER CERTIFIED SOLUTION
Avatar of simshp
simshp
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.