#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    Sweden
    Posts
    23
    Rep Power
    0

    external css, body-tag


    Hi,
    I have a page where I want to use an external css file to specify the font-family and font-size of the body in all the pages that include that css-file. I include it by doing this: <link rel="stylesheet" type="text/css" href="../main.css" /> and in that file I have this (among other things):
    Code:
    body
    	{
    		font-family: helvetica, arial;
    		font-size: 12px;
    		color: #000000;
    		background-color: #FFFFFF;
    		margin: 0px;
    		border: 0px solid black;
    	}
    It works in Opera 7.x but it doesn't work in IE 5.0, it ignores everything I put in there... It works if I copy the body tag to the page that should use it, but I don't want to do that...

    What is wrong?
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    Sweden
    Posts
    23
    Rep Power
    0
    *bump*
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    247
    Rep Power
    12
    Could you post the link the the page please?

    That will help further to see the problem but it could be a case of you having set the boy properties different in the page itself which has higher priorities over the external css which is ignored.
  6. #4
  7. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Apr 2003
    Location
    Italy, EU
    Posts
    517
    Rep Power
    12
    Really strange!!
    I've tried it in MSIE6 and works...
    I've also checked the compatibility between the CSS properties you've used and MSIE5 but I haven't found anything wrong!

    TRshady is right: post a link to the page!

    Good luck.
    Cheers, Dave
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    Sweden
    Posts
    23
    Rep Power
    0
    Here's a link to the page I wrote it for: http://home.swipnet.se/~w-63611/NyaFS/index.html But I have to warn you - it is in Swedish
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    Sweden
    Posts
    23
    Rep Power
    0
    I've written a small test-page displaying the error as well. Here's a link: http://home.swipnet.se/~w-63611/NyaFS/test.html (This one is in English)
  12. #7
  13. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2003
    Posts
    8
    Rep Power
    0

    Solution


    External css files should not have the <style> tags in them. They should have no HTML at all....

    remove the <style..> </style> tags and it should work...
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Location
    Sweden
    Posts
    23
    Rep Power
    0
    Ahh, sweet! Thanks!

IMN logo majestic logo threadwatch logo seochat tools logo