Conditional CSS Question...

Discussion in 'HTML' started by Andrew, Jan 31, 2007.

  1. Andrew

    Andrew Guest

    Hi,

    More so than I can come to grips with conditional comments I have tried
    and failed to set some css for IE5. The page containing the css can be
    seen:
    http://people.aapt.net.au/~adjlstrong/

    I understood that by specifying:

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

    I would include all versions of IE whose version numbers started with 5,
    and that the following simple css would center the main div on the page:

    body {text-align: center;}
    #content {text-align: left;}

    but it does not work!! What am I doing wrong?

    Thanks to anybody who can clear this up for me,

    Andrew

    --
    The STRONG Family Web Site
    http://www.strong-family.org
     
    Andrew, Jan 31, 2007
    #1
    1. Advertising

  2. Andrew

    Spartanicus Guest

    Andrew <> wrote:

    > More so than I can come to grips with conditional comments I have tried
    > and failed to set some css for IE5. The page containing the css can be
    > seen:
    >http://people.aapt.net.au/~adjlstrong/
    >
    > I understood that by specifying:
    >
    ><!--[if IE 5]>
    > <link rel="stylesheet" type="text/css" href="ie5.css" />
    ><![endif]-->
    >
    > I would include all versions of IE whose version numbers started with 5,


    Correct.

    > and that the following simple css would center the main div on the page:
    >
    > body {text-align: center;}
    >#content {text-align: left;}


    The important info you left out is that div#content has a defined width
    of 90%, given that, IE5.x should center div#content.

    > but it does not work!!


    Note that the available hacks to emulate multiple versions of IE on a
    single machine do not evaluate CCs correctly.

    --
    Spartanicus
     
    Spartanicus, Jan 31, 2007
    #2
    1. Advertising

  3. Andrew

    Andrew Guest

    On Wed, 31 Jan 2007 10:55:51 +0000, Spartanicus wrote:

    snip >>>>>>>>>
    >
    > Note that the available hacks to emulate multiple versions of IE on a
    > single machine do not evaluate CCs correctly.


    Hi Spartanicus,

    Thanks for your insight. I am hoping that this does not hold true for
    IEs4Linux which I will install tomorow:

    http://www.tatanka.com.br/ies4linux/page/Main_Page

    This should give me 6, 5.5 and 5 and hopefully a decent test for
    conditional comments. If not I have a copy of IE6 for offline testing
    anyway :)

    Thanks again for your trouble,

    Andrew

    --
    The STRONG Family Web Site
    http://www.strong-family.org
     
    Andrew, Jan 31, 2007
    #3
  4. Andrew

    Dylan Parry Guest

    Spartanicus wrote:

    > Note that the available hacks to emulate multiple versions of IE on a
    > single machine do not evaluate CCs correctly.


    Not true. Multiple IE installer (http://tredosoft.com/Multiple_IE) will
    take care of installing every version of IE for you, *and* fixes the
    problem with conditional comments not working.

    --
    Dylan Parry
    http://electricfreedom.org | http://webpageworkshop.co.uk

    Programming, n: A pastime similar to banging one's head
    against a wall, but with fewer opportunities for reward.
     
    Dylan Parry, Jan 31, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Eric
    Replies:
    4
    Views:
    782
    clintonG
    Dec 24, 2004
  2. Alec S.
    Replies:
    10
    Views:
    10,317
    Alec S.
    Apr 16, 2005
  3. Replies:
    6
    Views:
    585
    Jonathan N. Little
    Mar 18, 2006
  4. Summercool

    CSS color conditional on content

    Summercool, Nov 23, 2007, in forum: HTML
    Replies:
    3
    Views:
    873
    the DtTvB
    Nov 23, 2007
  5. richard
    Replies:
    12
    Views:
    785
    dorayme
    Mar 9, 2010
Loading...

Share This Page