【发布时间】:2018-02-26 20:56:52
【问题描述】:
我想设置我的页面,以便当用户将鼠标悬停在 div 中的链接上时,主体背景的颜色会发生变化,但仅限于悬停时。这是css
body {
background-color: black;
}
a {
color: white;
text-decoration: none;
}
a:hover {
color: white;
background-color: transparent;
text-decoration: underline;
}
【问题讨论】:
-
你会用javascript吗?据我所知,您所要求的仅靠 CSS 是不可能的
-
我对javascript有基本的了解,我愿意接受任何想法。