Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Target iPad, iPad only.

  • This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #33403
    dpersson
    Member

    Hi there. I’m currently working on a project, and I need to do some iPad specific styling.
    Is it possible to target just iPad?

    @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) 

    and

    @media (max-device-width: 1024px) and (orientation: landscape)

    both targets a lot more than the iPad, for instance a bunch of laptops. I want to target the iPad specifically. Is that possible with media queries?

    #82998
    TheDoc
    Member

    From Perishable Press

    /* iPad [portrait + landscape] */
    @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {

    }

    Something about using ‘only screen’, but I’m no expert.

    #82999
    TheDoc
    Member

    So much for reading your post… it’s still morning for me, forgive me.

    I’m not sure why laptops are picking up that first one though. I was under the impression that min-DEVICE-width shouldn’t do that.

    #83001
    markthema3
    Participant

    Would this work?

    @media handheld and (min-device-width: 768px) and (max-device-width: 1024px) {
    }
    #83038
    dpersson
    Member

    markthema3: I tried media type handheld, but it didn’t work. I’m pretty sure handheld targets older cell phones and not smart phones or iPad.

    TheDoc: Device can be any type of device with I guess.

    #84037
    dpersson
    Member

    Found a snippet here on CSS-tricks that seems to work very well. “@media only screen and (device-width: 768px)”

    #135933
    dannypaler
    Member

    try to use viewport work in portrait and lanscape

    #136483
    macharborguy
    Participant

    Just an update to an old post, for the sake of new information.

    There is currently no way to differentiate between a 9.7″ iPad and then 7.9″ iPad Mini other than via some sort of user interaction. Keep this in mind when designing for the iPad/iPadMini.

Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘CSS’ is closed to new topics and replies.