+ Post New Thread
Results 1 to 5 of 5
Coding Thread, Conditional IF Statement in HTML in Coding and Web Development; Hi Everyone I am getting ready to launch a new site however Internet Explorer is messing up the CSS. The ...
  1. #1

    Join Date
    Jul 2012
    Posts
    10
    Thank Post
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Question Conditional IF Statement in HTML

    Hi Everyone

    I am getting ready to launch a new site however Internet Explorer is messing up the CSS. The CSS works fine in Chrome, Safari and Firefox.

    One of my friends suggested I use a Conditional IF statement and create a separate CSS stylesheet.

    I have created a separate CSS sheet and used the following code to link it just for IE:

    <!--[if IE]>
    <link rel="stylesheet" type="text/css" href="IE-ONLY.css"/>
    <![endif]-->

    Then placed the original stylesheet underneath this.

    For some reason IE is not picking up this action.

    Can anyone offer an suggestions please ??????
    Thanks in advance

  2. #2
    Captain_Slow's Avatar
    Join Date
    May 2010
    Location
    Chester, England
    Posts
    15
    Thank Post
    0
    Thanked 3 Times in 3 Posts
    Rep Power
    9
    Hi, have you tried this...

    HTML Code:
    <!--[if IE]>
    <link rel="stylesheet" type="text/css" href="IE-ONLY.css"/>
    <![endif]-->
    <!--[if !IE]> -->
    <link rel="stylesheet" type="text/css" href="normal-css.css"/>
    <!-- <![endif]-->

  3. Thanks to Captain_Slow from:

    webtech21 (4th December 2012)

  4. #3

    3s-gtech's Avatar
    Join Date
    Mar 2009
    Location
    Wales
    Posts
    2,830
    Thank Post
    146
    Thanked 574 Times in 518 Posts
    Rep Power
    154
    For mine, I place the original stylesheet reference above the IE one. Works fine then - that's using <!--[if lt IE 9]> as I have some CSS3 elements that don't work in older versions.

  5. #4

    Geoff's Avatar
    Join Date
    Jun 2005
    Location
    Fylde, Lancs, UK.
    Posts
    11,803
    Thank Post
    110
    Thanked 583 Times in 504 Posts
    Blog Entries
    1
    Rep Power
    224
    Your comments are messed up. As per @Captain_Slow you need to alter your original to something like this:

    Code:
    <!--[if IE]><!-->
    <link rel="stylesheet" type="text/css" media="screen" href="ie.css" />
    <!--<![endif]-->
    More info here:

    http://www.quirksmode.org/css/condcom.html
    Last edited by Geoff; 3rd December 2012 at 03:22 PM.

  6. #5

    Join Date
    Jul 2012
    Posts
    10
    Thank Post
    1
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    This appears to have worked thanks so much for a quick response. I am going to be styling the sheet later on so will let you know Many Thanks

SHARE:
+ Post New Thread

Similar Threads

  1. [PHP] Error In If Statement
    By glennda in forum Web Development
    Replies: 10
    Last Post: 31st March 2011, 12:04 PM
  2. Centering a scrolling text box in HTML
    By PWaite in forum Web Development
    Replies: 15
    Last Post: 19th January 2009, 09:53 AM
  3. Network links in HTML for an intranet style doo-daa...
    By Joedetic in forum How do you do....it?
    Replies: 11
    Last Post: 23rd May 2007, 11:59 AM
  4. Excel IF statement maybe VB
    By danIT in forum General Chat
    Replies: 1
    Last Post: 5th January 2007, 12:12 PM
  5. Replies: 14
    Last Post: 14th June 2006, 05:57 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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