Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 8 of 8
  1. #1
    Join Date
    Nov 2007
    Posts
    753
    Tokens
    0

    Default CSS depending on browser

    Hey just to let you guys know. Ive found this tutorial.
    I thought it might be useful to you guys

    http://boon-tech.com/tutorials.php?i...wser_dependent

    Moved by Agesilaus (Forum Moderator) from Designing and Development: Please post in the correct forum next time.
    Last edited by Agesilaus; 05-01-2008 at 11:48 PM.
    Publishing free website designs, watch this space!
    Total number of designs published: 0
    Current work in progress: Landscape Design


  2. #2
    Join Date
    Oct 2007
    Location
    Luton, England
    Posts
    1,548
    Tokens
    388
    Habbo
    DeejayMachoo

    Latest Awards:

    Default

    Quote Originally Posted by Forge View Post
    Hey just to let you guys know. Ive found this tutorial.
    I thought it might be useful to you guys

    http://boon-tech.com/tutorials.php?i...wser_dependent
    odea

    Quote Originally Posted by tutorial
    Code:
    <?
    if ($name = strstr ($HTTP_USER_AGENT, "MSIE")) 
    { 
    ?>
    <link rel="stylesheet" href="ie_stylesheet.css">
    <?
    } 
    else if ($name = strstr ($HTTP_USER_AGENT, "Netscape")) 
    { 
    ?>
    <link rel="stylesheet" href="netscape_stylesheet.css">
    <?
    } 
    else
    { 
    ?>
    <link rel="stylesheet" href="others.css">
    <?
    } 
    ?> 
    Code:
    <?
    if ($name = strstr ($HTTP_USER_AGENT, "MSIE")) {
    echo("<link rel=\"stylesheet\" href=\"ie_stylesheet.css\">");} 
    elseif ($name = strstr ($HTTP_USER_AGENT, "Netscape")) { 
    echo("<link rel=\"stylesheet\" href=\"netscape_stylesheet.css\">");
    } else { 
    echo("<link rel=\"stylesheet\" href=\"others.css\">"); 
    } 
    ?>


  3. #3
    Join Date
    May 2006
    Posts
    1,797
    Tokens
    0

    Latest Awards:

    Default

    Nice find

    But i think most people already know how to do it..
    Coming and going...
    Highers are getting the better of me

  4. #4
    Join Date
    Oct 2007
    Location
    Luton, England
    Posts
    1,548
    Tokens
    388
    Habbo
    DeejayMachoo

    Latest Awards:

    Default

    Quote Originally Posted by MrCraig View Post
    Nice find

    But i think most people already know how to do it..
    yeh and also if your gona be xhtml and valid css then you dont need this


  5. #5
    Join Date
    May 2006
    Location
    Hull
    Posts
    7,701
    Tokens
    2,430
    Habbo
    Moh

    Latest Awards:

    Default

    And for the older versions of IE, I think if you view Habbo's Source code its there

  6. #6
    Join Date
    Aug 2006
    Posts
    180
    Tokens
    0

    Default

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

    conditional comments. Much easier?

  7. #7
    Join Date
    Dec 2007
    Posts
    412
    Tokens
    0

    Default

    Why all the PHP code if you could do a simple <!--[if IE]> <![endif]-->?

  8. #8
    Join Date
    Aug 2005
    Location
    Newcastle
    Posts
    1,417
    Tokens
    0

    Latest Awards:

    Default

    I agree wit above two statements, however it may be useful for people who are using unusual browsers which are worse than IE (I dont think it's possible, but it could be).

    It may be of help to some other users, +rep if possible.



Posting Permissions

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