HTML <style> with media pointer

You are Here:

HTML <style> with media pointer

The pointer value of the media attribute specifies whether the user has a pointing device (such as a mouse), and if so, how accurate the primary pointing device is.

Example

HTML Online Editor
<!DOCTYPE html> <html> <head> <style media="screen and (pointer: fine)"> label{ color:red; } #fine{ color:green; } #coarse, #none{ color:#fff; } </style> <style media="screen and (pointer: none)"> label{ color:green; } #none{ color:green; } #coarse, #fine{ color:#fff; } </style> <style media="screen and (pointer: coarse)"> label{ color:blue; } #coarse{ color:green; } #none, #fine{ color:#fff; } </style> </head> <body> <input id="test" type="checkbox"> <label for="test">Look at me!</label> <p id="fine">You are using fine pointer Device</p> <p id="coarse">You are using Coarse pointer Device</p> <p id="none">You are using no pointer Device</p> </body> </html>

Attribute Value

ValueExplanation
noneThe primary input mechanism does not include a pointing device.
coarseThe primary input mechanism includes a pointing device of limited accuracy.
fineThe primary input mechanism includes an accurate pointing device.

Reminder

Hi Developers, we almost covered 99.5% of HTML Tutorials with examples for quick and easy learning.

We are working to cover every Single Concept in HTML.

Please do google search for:

Join Our Channel

Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.

This channel is primarily useful for Full Stack Web Developer.

Share this Page

Meet the Author