The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Need help with IE issues

  • This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • #144187

    I have been staring at this CSS and HTML for days now and cannot get it to display correctly in IE. I’m trying to get the minimum to display in version 8, I don’t care about IE6 or IE7 but need to get it at least looking reasonable in IE8.

    []( “”)

    Can anyone tell me why:

    1) The header area is displaying further down the page and the background image is not

    2) Why is it not centered

    It displays and works perfectly in Firefox, Safari and Chrome, but IE is throwing a complete nightmare.

    Any help most appreciated!




    Can’t test in actual IE8 but in IE10 developer mode it seems fine in IE8 standards & quirks modes.

    That was on the second look though…first time I had the same issues.


    First thing to do is to make sure there is ABSOLUTELY NOTHING (not even a SPACE) before declaring your doctype. Right now there’s way too much:


    <!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
    <!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
    <!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
    <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
    <!DOCTYPE html>
    <html xmlns="" xml:lang="en-gb" lang="en-gb" dir="ltr">

    Should be:

        <!DOCTYPE html>
        <!--[if lt IE 9]>         <html xmlns="" xml:lang="en-gb" lang="en-gb" dir="ltr" class="no-js lt-ie9"> <![endif]-->
        <!--[if gt IE 8]><!--> <html xmlns="" xml:lang="en-gb" lang="en-gb" dir="ltr" class="no-js"> <!--<![endif]-->

    No IE7 or “less than IE7” detection needed.


    Thanks for the replies, there is actually a shedload of code above the DOCTYPE as this is a Joomla template

    <!–[if lt IE 7]> <html class=”no-js lt-ie9 lt-ie8 lt-ie7″> <![endif]–>
    <!–[if IE 7]> <html class=”no-js lt-ie9 lt-ie8″> <![endif]–>
    <!–[if IE 8]> <html class=”no-js lt-ie9″> <![endif]–>
    <!–[if gt IE 8]><!–> <html class=”no-js”> <!–<![endif]–>

    defined(‘_JEXEC’) or die;

    // Getting params from template
    $params = JFactory::getApplication()->getTemplate(true)->params;

    $app = JFactory::getApplication();
    $doc = JFactory::getDocument();
    $this->language = $doc->language;
    $this->direction = $doc->direction;
    $menu = $app->getMenu()->getActive();
    $pageclass = ”;

    if (is_object($menu))
    $pageclass = $menu->params->get(‘pageclass_sfx’);

    // Detecting Active Variables
    $option = $app->input->getCmd(‘option’, ”);
    $view = $app->input->getCmd(‘view’, ”);
    $layout = $app->input->getCmd(‘layout’, ”);
    $task = $app->input->getCmd(‘task’, ”);
    $itemid = $app->input->getCmd(‘Itemid’, ”);
    $sitename = $app->getCfg(‘sitename’);

    if($task == “edit” || $layout == “form” )
    $fullWidth = 1;
    $fullWidth = 0;

    // Add Stylesheets


    I’ve always had code above the doctype in other Joomla sites and never had any issues before.

    This is based on a vanilla template from and looking at their code it has code above the DOCTYPE.



    Well….regardless of the source, you should just never have anything before the doctype, or else your site will be screwed up in IE (not to mention your code is just not valid). It’s great that you never had issues with the template before, but this time you do, so if you want to keep using the same template, then you’ll experience problems.

    I mean, it’s up to you. Generally, if you feed IE valid code, things will be fine. But once you feed IE some invalid code (such as having something/anything before the Doctype), then you’ll have to accept likely funkiness.


    I don’t like the boilerplate’s solution adding a classname to the html-tag, it just blows up your css code really any browser has to load. I always go for an explicit stylesheet fixing IE issues embedded via conditional tags in addition to that one for browsers who know how to behave :-)


    My HTML validator throws dozens of warnings and errors. Main problem probably is a kind of nested conditional tag:

    <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->


    No, the main problem is that those tags come before the doctype.

Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘CSS’ is closed to new topics and replies.