Today I Learned - Rocky Kev

TIL the hover media feature

POSTED ON:

TAGS:

Today I learned!

There's a media feature to test if the system you're operating in can hover.

If you're on a phone or tablet, chances are -- you cannot hover.
But if you're on desktop using a mouse -- you can!

@media (hover: hover) {
a:hover {
background: yellow;
}
}

mdn - hover


Related TILs

Tagged:

TIL the alternate keyword

If 'alternate' appears along with the stylesheet keyword, the linked file is an alternative stylesheet. It won’t be applied to the document, but it will be ready for when we need it.

TIL Logical Properties

For that sweet sweet Internationalization you want to avoid directional words like 'left', 'right', 'top', and 'bottom'.

TIL Using pseudo-classes in your querySelector!

let notTuna = document.querySelectorAll('.sandwich:not(.tuna)')