css file works in IE but not in firefox

  • Thread starter Thread starter puja
  • Start date Start date
P

puja

hi all,

I have an asp.net website where am including .css file dynamically on page
load event. For diff users, there is diff CSS file. So after user logs in, I
am setting CSS href on page load. My CSS file works fine in IE 6.0 when i
specify the absolute path. eg- href ="D:\Mywebsite\css\mycssfile.css" but
this full path does not work in firefox 1.5.0.5. When I load page in
firefox, css file seems to have no effect on page.

If I use relative path eg- href="css\mycssfile.css" it works fine in Firefox
but doesn't work in IE 6.0,

Is there any way to get around this problem ?

thanks
puja
 
actually I have this in my page load event
MyStyleSheet.Attributes.Add("href", Server.MapPath("css") +
"/mycssfile.css"); ( this works fine in IE but not in firefox)

AND if I use this

MyStyleSheet.Attributes.Add("href", "css/mycssfile.css"); (this
works fine with firefox but not IE)

any ideas ?




Your absolute path shouldn't be like "d:\\..."?
Try it "http://...test.css"?

puja ??:
 
Compare the html scurce code between IE and Firefox. After my test, it
works fine.

Such as,

<link rel="stylesheet" href="style/Forum.css" type="text/css"
media="screen">

IE or Firefox can works. There is no problem on it.
Good luck.

Sincerely,
simida

puja 写é“:
 
thanks so much for all your effort simida but I already got my problem
solved. :)



Compare the html scurce code between IE and Firefox. After my test, it
works fine.

Such as,

<link rel="stylesheet" href="style/Forum.css" type="text/css"
media="screen">

IE or Firefox can works. There is no problem on it.
Good luck.

Sincerely,
simida

puja ??:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top