Different CSS for different browsers (2 posts)

  1. drexler19
    Posted 9 years ago #

    I have a problem with the footer of my blog in Internet explorer, where it has been pushed over to the right of the screen. I can't seem to fix it in the css and was instead wondering if there was some way to use a php conditional or something to call up a different css stylesheet depending on the browser. EG, a simple one for IE and the usual more complicated one for other browsers. If anyone knows a way of doing this, I would be really grateful! Thanks! Also If anyone knows an IE hack for positioning a browser then I would also be really grateful! Thanks again!

  2. mozey
    Posted 8 years ago #

    <script language="JavaScript"><!--
    browser_version= parseInt(navigator.appVersion);
    browser_type = navigator.appName;

    if (browser_type == "Microsoft Internet Explorer" && (browser_version >= 4)) {
    document.write("<link REL='stylesheet' HREF='YOURIESHEETHERE' TYPE='text/css'>");

    else {
    document.write("<link REL='stylesheet' HREF='YOURDEFAULTSHEETHERE' TYPE='text/css'>");
    // --></script>

    Note that your header is usually like this:

    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />

    ITS UGLY, but hey!,

Topic Closed

This topic has been closed to new replies.

About this Topic