[英]How to make &:hover accessible? Can i use focus and hover together?
我們有一個下拉菜單,僅CSS,而現在有點混亂了。 我意識到可能會花費一些時間來重構整個東西以使用JS focus。
我想讓我的下拉菜單可訪問。 我將SCSS與&:hover
,以使菜單下拉。 是否可以在SCSS中說&:hover OR &:focus
?
用戶徘徊或專注於元素都沒有關系。 這就是為什么您可以在scss中使用AND
運算符,或者簡單地說就是逗號:
&:hover, &:focus{
//styles for both the hover and the focus state
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.