Wednesday, November 07, 2007

ASP.Net 2.0 Tip : CSS is not applied on my aspx page

Hi Folks,

You might face this problem on asp.net 2.0,if you create an aspx page and you reference the css file on the header of this page,you will face that the css classess are not applied on that page even if the css reference is right.

And css link is working on other pages but is not working on the new created page.

The workaround of this issues is to remove the below line of the html code :



!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"


this will instantly apply the css classes on your page.

Happy .Netting..... :)


Regards,
Moustafa arafa

2 comments:

Unknown said...

Hi Moustafa, didnt work it is a known issue, I have been looking on the web for a resoultion. Also affects 3.5 and IE and Mozilla

Anonymous said...

THANK YOU for posting this!

I was having a lot of trouble with getting my CSS files to work and this fixed it!