Advanced Search

Results 1 to 8 of 8

Thread: Light "browser sniffing" css style script

  1. #1
    Join Date
    May 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Light "browser sniffing" css style script

    HI!, I am VERY obsessive when it comes to accessibility, and I need a js script (light as possible) to detect the user's browser and pull up the correct style sheet. I need this for Opera, Firefox, Netscape, IE, and if possible, Safari.

    Eg: a person is using netscape and comes to my site, so the js pulls up the style that makes the site look the way it was intended.

    If you could help me in any way, it would be great!

    PS here is my site: http://fatcatwebhosting.com, and there is a js script there already that kind of works.... it seems to work for all browsers (opera, netscape, and firefox) that I need, other then IE....

    Edit: I do not know how appropriate this may be, but for anyone who could create this script for me, I would love to supply you with free web hosting.
    Last edited by catzzzvb; 05-20-2007 at 07:59 PM. Reason: lack of interest

  2. #2
    Join Date
    Feb 2007
    Location
    England
    Posts
    254
    Thanks
    0
    Thanked 5 Times in 5 Posts

    Default

    Don't code individually for each browser. Make one css that covers them all. If you make it to standards, you will only need to add a few extra lines to make it work with IE.

    As for your site:

    Optimise the image. its like 175kb! --- no-one will host with you if your site isn't optimised.
    Try reducing the page width of your browser and your title bar doesn't adjust, but the rest of the page does.



    p.s. when I visited with firefox I got 4 style sheets! 2 IE, 1 Opera and 1 Safari! None were right. lol
    Last edited by Bob90; 05-20-2007 at 08:49 PM.

  3. #3
    Join Date
    May 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Bob90 View Post
    Don't code individually for each browser. Make one css that covers them all. If you make it to standards, you will only need to add a few extra lines to make it work with IE.

    As for your site:

    Optimise the image. its like 175kb! --- no-one will host with you if your site isn't optimised.
    Try reducing the page width of your browser and your title bar doesn't adjust, but the rest of the page does.

    Thanks for the tips, but how do I optimize a image? Also, can you explain the while width thing? I didn't get it... And also, the site works in all those browsers, but there are simple little things like the title is a few px off, or the navagation tabs are a few px too low...I can't find a way to cover all that... That is why I chose to use multiple style sheets.

    Edit: -.-....I feel so ....stupid right now... I can't beleive that I could remember a .JPG has better optimization then .PNG....Sorry..
    Last edited by catzzzvb; 05-20-2007 at 08:52 PM. Reason: Sigh....I forgot...

  4. #4
    Join Date
    Feb 2007
    Location
    England
    Posts
    254
    Thanks
    0
    Thanked 5 Times in 5 Posts

    Default

    I know you're a new coder, but you might want to try stripping/resetting all of the style from the page. Then applying your own. You should be able to find CSS to reset ot strip all styles then just add your own. Fresh slate!

    As for the width thing, how are you setting it? from a database or asp?

  5. #5
    Join Date
    May 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Bob90 View Post
    I know you're a new coder, but you might want to try stripping/resetting all of the style from the page. Then applying your own. You should be able to find CSS to reset ot strip all styles then just add your own. Fresh slate!

    As for the width thing, how are you setting it? from a database or asp?
    Umm what? I am so lost... I did all the css work.... =) And the width... that's just set with the width: ; in the Css... I don't even know what asp is!! LOL

    Edit...Also, I have been coding for years now... I am not that good though..Also, I just started CSS a few weeks ago.

  6. #6
    Join Date
    Jun 2006
    Location
    Acton Ontario Canada.
    Posts
    677
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    Also, these comments are messing up your page in FF.
    <!-----------------------------
    PRIMARY NAVAGATION STARTS HERE
    ------------------------------->
    Keep it down to two dashes that should fix it. <!-- commented text -->
    Also, dont use comment tags in your styles, xhtml wont use those styles.
    your sending the content type as text/html when your using xhtml markup.
    Put the rest of your styles and scripts into their own files, and then validate your pages.
    - Ryan "Boxxertrumps" Trumpa
    Come back once it validates: HTML, CSS, JS.

  7. #7
    Join Date
    Feb 2007
    Location
    England
    Posts
    254
    Thanks
    0
    Thanked 5 Times in 5 Posts

    Default

    just save this image

    http://www.robertgarford.com/cat.jpg //removed now (catzzvb, if you want it again contact me.)

    Last edited by Bob90; 05-21-2007 at 07:32 AM. Reason: removed image from server

  8. #8
    Join Date
    May 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by boxxertrumps View Post
    Also, these comments are messing up your page in FF.
    <!-----------------------------
    PRIMARY NAVAGATION STARTS HERE
    ------------------------------->
    Keep it down to two dashes that should fix it. <!-- commented text -->
    Also, dont use comment tags in your styles, xhtml wont use those styles.
    your sending the content type as text/html when your using xhtml markup.
    Put the rest of your styles and scripts into their own files, and then validate your pages.
    Alright...The only page that is up to date (as best as I had them) is the home (index.html) page.

    Thanks for the tips.

    Thanks for all the help, can you guys sick around for a little while? I can't update anything right now because I am uploading a VERY VERY large file. Thanks

Bookmarks

Posting Permissions

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