468,140 Members | 1,477 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,140 developers. It's quick & easy.

css file works in IE but not in firefox

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
Jul 31 '06 #1
4 2071
Your absolute path shouldn't be like "d:\\..."?
Try it "http://...test.css"?

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
Jul 31 '06 #2
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 ?


"simida" <yo**********@gmail.comwrote in message
news:11*********************@p79g2000cwp.googlegro ups.com...
Your absolute path shouldn't be like "d:\\..."?
Try it "http://...test.css"?

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

Jul 31 '06 #3
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 写道:
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 ?


"simida" <yo**********@gmail.comwrote in message
news:11*********************@p79g2000cwp.googlegro ups.com...
Your absolute path shouldn't be like "d:\\..."?
Try it "http://...test.css"?

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 wheni
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
Jul 31 '06 #4
thanks so much for all your effort simida but I already got my problem
solved. :)

"simida" <yo**********@gmail.comwrote in message
news:11*********************@m79g2000cwm.googlegro ups.com...
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 ??:
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 ?


"simida" <yo**********@gmail.comwrote in message
news:11*********************@p79g2000cwp.googlegro ups.com...
Your absolute path shouldn't be like "d:\\..."?
Try it "http://...test.css"?

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

Jul 31 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by z0rr0 | last post: by
3 posts views Thread by yehaimanish | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.