Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>How can I get the hover effects when I'm using the mouse, but suppress them when I'm using the touchscreen?</p> </blockquote> <p>Maybe don't think of it so much as suppressing hover effects for touchscreens, but as adding hover effects for mouse events?</p> <p>If you want to keep the <code>:hover</code> effects in your CSS you could specify different styles for different media:</p> <pre><code>@media screen { /* hover styles here */ } @media handheld { /* non-hover styles here */ } </code></pre> <p>Except that unfortunately there are plenty of mobile devices that ignore this and just use the screen rules. Fortunately a lot of newer mobile/tablet browsers do support some fancier media queries:</p> <pre><code>@media screen and (max-width:800px) { /* non-hover styles here */ } </code></pre> <p>So even if the "screen" or "handheld" part is ignored the "max-width" will do the trick for you. You could just assume that anything with a screen smaller than 800 pixels must be a tablet or phone, and not use hover effects. For the rare users who are using a mouse on a low resolution device they wouldn't see the hover effects but your site would be fine otherwise.</p> <p>Further reading on media queries? There are plenty of articles about this online - here is one: <a href="http://www.alistapart.com/articles/return-of-the-mobile-stylesheet" rel="noreferrer">http://www.alistapart.com/articles/return-of-the-mobile-stylesheet</a></p> <p>If you shift the hover effects out of your CSS and apply them with JavaScript then you could bind specifically to mouse events, and/or again you could just make some assumptions just based on screen size with the worst-case "problem" being that some user who is using a mouse misses out on the hover effects.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload