Results 1 to 5 of 5

Thread: 1 Validation error - <!--[if IE]> ie fix?

  1. #1
    Join Date
    Jan 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default 1 Validation error - <!--[if IE]> ie fix?

    Hi Guys

    This ones driving me crazy. I have 1 validation error listed below

    Lexical error at line 237, column 3. Encountered: "[" (91), after : "<!"

    My CSS is below, id there a possible fix to overcome this?

    CSS
    ===
    234 <!--[if IE]>
    235 .#sidebar1 {padding-top: 30px;}
    236 .#mainContent {zoom: 1; padding-top: 15px;}
    237 <![endif]-->

  2. #2
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    You can't have conditional comments in your css code. What you can do is put that code on your html page like this:
    Code:
    <!--[if IE]>
    <style type="text/css">
    #sidebar1 {padding-top: 30px;}
    #mainContent {zoom: 1; padding-top: 15px;}
    </style>
    <![endif]-->
    Good luck!
    Eddy Proca
    I love Dropbox. Get it through my girlfriend's referral link (I reached my limit) and both you and her get 500 MB extra! Thanks and you're welcome!

  3. #3
    Join Date
    Jan 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Snookerman View Post
    You can't have conditional comments in your css code. What you can do is put that code on your html page like this:
    Code:
    <!--[if IE]>
    <style type="text/css">
    #sidebar1 {padding-top: 30px;}
    #mainContent {zoom: 1; padding-top: 15px;}
    </style>
    <![endif]-->
    Good luck!
    Thanks for your advice Snookerman. I removed the conditional statement from the CSS and placed it the HTML template page header. Good News is the CSS validates with the code removed from the external stylesheet, but the bad news is that the ie bug fix is not applied to my page when i place it in the <head>. Not sure where I should put the statement?

  4. #4
    Join Date
    Oct 2008
    Location
    Sweden
    Posts
    2,023
    Thanks
    17
    Thanked 319 Times in 318 Posts
    Blog Entries
    3

    Default

    Could it be because I removed the periods (.#sidebar1 {padding-top: 30px;})? I thought it was part of the line numbers so I removed them.
    Eddy Proca
    I love Dropbox. Get it through my girlfriend's referral link (I reached my limit) and both you and her get 500 MB extra! Thanks and you're welcome!

  5. #5
    Join Date
    Jan 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ive got the bug fix to work in the main body of the page, but if you could take a quick look at the following page www.cdsrentals.com you can see there is a block of space indented to the top of the left hand side menu when viewed in IE6.

    If i remove the conditional statement from the html page the space disappears!

    I cant work this one out.

    I appreciate all your help on this Snookerman, its really driving me crazy after two whole days now

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •