pointer
and hover
properties - are aimed at improving support for finger-operated devices.hover
property is 1 if the device has a pointer that you can hover
over the element without clicking, and 0 if not. The behavior of a website that is familiar to desktop computers, when a drop-down menu or tooltip appears over a mouse pointer item, creates many problems for tablet and smartphone users. The hover
property will allow you not to abandon it completely, but continue to use it where possible. Example:@media (hover) {
.menu > li { display : inline- block ; }
.menu ul { display : none ; position : absolute ; }
.menu li : hover ul { display : block ; list-style : none ; padding : 0 ; }
}
pointer
property can be coarse
- for touchscreens controlled by fingers, fine
for mouse or stylus, and none
. Example:@media (pointer: coarse) {
input [ type = "checkbox" ] , input [ type = "radio" ] {
min-width : 30px ;
min-height : 40px ;
background : transparent ;
}
}
pointer
and hover
, another property appeared - script
. It takes the value 1 if the device supports JavaScript and 0 if not, or JavaScript is currently disabled.Source: https://habr.com/ru/post/144460/
All Articles