SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: Help with webkit, css3, and media queries

  1. #1
    SitePoint Guru team1504's Avatar
    Join Date
    May 2010
    Location
    Okemos, Michigan, USA
    Posts
    727
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Help with webkit, css3, and media queries

    Hey guys, I have two questions that I was wondering if you could help me with.

    First, using media-queries or some other technique is there a way to link a CSS stylesheet only if the browser is Safari?

    The reason behind this my second question.
    I found this really cool graphic-animation using CSS3 & webkit, but for some reason it is laggy in Chrome, which is also a webkit browser, but fins in Safari.

    Would you be willing to help me fine tune the code so that it is less laggy in Chrome or help me develop a way that the suer only sees it; in other words, the stylesheet is only attached, if the browser is Safari?

    Here is the animation in action.
    And here is the CSS behind it.

  2. #2
    Non-Member Kalon's Avatar
    Join Date
    Aug 2010
    Location
    At my computer
    Posts
    2,012
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    there is a truck load of info on the www on how to detect browser type

  3. #3
    SitePoint Guru team1504's Avatar
    Join Date
    May 2010
    Location
    Okemos, Michigan, USA
    Posts
    727
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Post

    I know, but I wanted to post a topic in case someone else wanted to know.
    As soon as I get something that works, Ill post it

  4. #4
    SitePoint Guru team1504's Avatar
    Join Date
    May 2010
    Location
    Okemos, Michigan, USA
    Posts
    727
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    With my research there is no way to detect the browser with CSS3 @media-queries.
    As Kalon suggested above, Javscript is the way to go

  5. #5
    Ripe Tomatos silver trophybronze trophy Rayzur's Avatar
    Join Date
    Jun 2007
    Location
    Texas
    Posts
    4,174
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    You can target webkit browsers with this

    Code:
    @media screen and (-webkit-min-device-pixel-ratio:0) {
        div { property:value }/* target  webKit browsers*/
    }
    It's hacky though and I would prefer a js method for a public site.

  6. #6
    SitePoint Guru team1504's Avatar
    Join Date
    May 2010
    Location
    Okemos, Michigan, USA
    Posts
    727
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    t's hacky though and I would prefer a js method for a public site.
    I agree it is hacky. If the JS solution Kalon is helping me with here doesn't end up working, which I am very thankful for the help by the way Kalon, then I may have to resort to that. Also CSS3 doesnt seem, especially @media queries doesn't seem to be supported much at least not yet, but then you still have post-legacy, but older browsers such as firefox 2.0, chrome 2.0, safari 3.0, and IE 8,7,& 6

Tags for this Thread

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
  •