css for mobile only

Asked

Viewed 2,009 times

2

Well I’m used to checking the css this way:

@media only screen and (max-width: 920px) {}

The problem is that has cell phones with very high resolution, there is some other way for me to check without the use of Px?

  • 1

    See if this helps: https://coderwall.com/p/ygcyha/how-to-get-real-mobile-css-resolutions-for-responsive-design

  • 1

    Use Javascript and a Pattern to detect mobile browsers. =)

  • 1

    This article is sensational http://www.quirksmode.org/blog/archives/2010/04/a_pixel_is_not.html

  • This article explains very well on how to detect using Mediaquery mobile devices.

1 answer

1

You can try using @media (Pointer: Oarse), with it you can detect if the user is using a mouse or navigates through a touch screen, the interesting thing is that even in notebooks with touch screen it accuses the mouse as main and enters the query

If you are curious follow practical example I found on the net http://codepen.io/andresgalante/pen/bBEJKg

Browser other questions tagged

You are not signed in. Login or sign up in order to post.