1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.2 IE conditionals not working

Discussion in 'Styling and Customization Questions' started by SonicRC, Oct 20, 2013.

  1. SonicRC

    SonicRC Well-Known Member

    Hi! :)

    It's the first time I have to work with IE conditionals. So I tried to put the following code in the page-container template:

    <xen:hook name="page_container_head">
        <!--[if lt IE 9]>
        <xen:require css="IE.css" />
    If I do it that way, the IE.css gets applied on all Browsers(even on Firefox, Safari etc) not only on IE8 and below.

    any idea why?
  2. Chris D

    Chris D XenForo Developer Staff Member

    That'll be because the CSS is included via the compiled template which happens when the template is saved. The IE conditionals are evaluated as the page is loaded.

    You may want to include the CSS directly in the template using <style> tags or, create an actual .css file with those customisations in, and include that as such:

    <!--[if lt IE 9]>
    <link rel="stylesheet" type="text/css" href="styles/css/IE.css" />
  3. SonicRC

    SonicRC Well-Known Member

    Thank you Chris. (y)

    I'll use <style> then. It's not perfect but that's never if you have to work with IE. :rolleyes:

Share This Page