Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有 3 个 div
按此顺序 1 - 2 - 3
当我将鼠标悬停在2上时,我想更改1 和 3的背景 (使用 css)
到目前为止只有 div 3会改变
使用这些类在 CSS 中悬停时设置它们的样式。例子:
<div class="one"> First </div> <div class="two"> Second </div> <div class="three"> Third </div> .one:hover, .three:hover { background: pink; }