Support » Themes and Templates » IE Conditional Comments in PHP/CSS?

  • I’m experimenting with CSS layouts, and I’m having a terrible time getting them to work in IE. I’d like to use conditional comments like so:
    (!--[if expression]) HTML ([endif]--) *
    to specify certain things for IE, but they seem to work only in HTML documents. Since all my WP files are either CSS or PHP, I’m at a bit of a loss. I’ve seen these conditional comments used in PHP files (WP blogs, even) before- is there something you have to put in the head tag to get them to work?
    I know know how much the URL would help, expecially since it’s just a test page I set up to try the stylesheet on, but there it is:
    *Replace ) and ( with > and <.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Loden,
    I’ve not a clue about conditional comments. Anything to do with trying to get IE to behave itself can be terribly frustrating. Have you checked any IE forums at all? Would be interesting to hear what you discover.

    I have the code in my blog. Help yourself. You will know it when you see it.

    LOL Very good Root…
    Loden, you have to keep all these technologies seperate… 🙂
    WP Uses PHP to output HTML. PHP has absolutely no knowledge of HTML (kinda), so it won’t influence any HTML you enter.

    Turns out most of my problems with the comments were due to my own stupidity. That’ll show me not to do stuff like this at two in the morning.
    Just one thing- it seems that conditional comments have to consist of tags, they can’t be used for attributes within tags. Is this true?


Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘IE Conditional Comments in PHP/CSS?’ is closed to new replies.