Results 1 to 3 of 3
  1. #1
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    How to format when using multiple browsers

    As some of you are aware, if you view text in different browsers ( say IE and Firefox) the
    formatting of the text sometimes changes.

    A recent example was when a Lounger had an H1 tag that rendered differently in Firefox than in IE.
    This is not a big problem as it did not effect a users view of the overall pages but there is another little
    know trick that you can keep in your toolbox if the need arises and this example could be a way of dealing
    with this issue. The trick is to use the IE if statement.

    Firstly you can create a standard external css file and link it in the head tags as normal, thus:
    <link href="main.css" rel="stylesheet" type="text/css" />

    If you find that a IE browser renders your preferred formatting (as it usually does) you can create
    additional css file specific to your browser and adjust the formatting to suit your needs and for that
    particular IE version. You can then add this code between your head tags:

    For IE6 use:

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


    For any version of IE5 (including 5.0, 5.01, 5.5, etc) use:

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



    or if you want it for any IE browser

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


    You can use multiple if in your head tags.
    Jerry

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: How to format when using multiple browsers

    As a footnote, if you put the browser in standards-compliant mode by specifying a complete DOCTYPE declaration in every page, there are very few important differences in rendering between the major browsers (IE5.5/6, Moz/Fx, Opera). To see a list of possible DOCTYPEs to choose from, visit the W3C article Recommended DTDs to use in your Web document. For nearly all purposes, HTML 4.01 Strict is a good choice; some people might need XML features and be willing to trade off some compatibility, and for them XHMTL might be better.

  3. #3
    Platinum Lounger
    Join Date
    Feb 2002
    Location
    A Magic Forest in Deepest, Darkest Kent
    Posts
    5,681
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: How to format when using multiple browsers

    Thanks Jefferson, that is a really useful resource that I hadn't seen on W3C
    Jerry

Posting Permissions

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