Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
July 24, 2019 06:04 pm GMT

Dont comma-separate :focus-within if you need deep browser support

I really like :focus-within. It's a super useful selector that allows you to essentially select a parent element when any of its children are in focus.

Say you wanted to reveal some extra stuff when a <div> is hovered...

div:hover {  .extra-stuff {     /* reveal it */  }}

That's not particularly keyboard-friendly. But if something in .extra-stuff is tab-able anyway (meaning it can be focused), that means you could write it like this to make it a bit … Read article

The post Don’t comma-separate :focus-within if you need deep browser support appeared first on CSS-Tricks.


Original Link: https://css-tricks.com/dont-comma-separate-focus-within-if-you-need-deep-browser-support/

Share this article:    Share on Facebook
View Full Article

CSS Tricks

A Web Design Community curated by Chris Coyier

More About this Source Visit CSS Tricks