-2
A
回答
1
我相信这(JSBin)是你想要的。
如果我理解正确的问题,那就是棘手的一点是,当悬停,橙色背景超出了家长的高度。
我赶紧把这个例子在一起,我有你可以用一个:before
元素实现这一目标完全的感觉。
HTML: 气候 联系我们
CSS:
html {
font-family: helvetica;
}
a {
text-decoration: none;
}
nav {
background-color: rgb(29, 106, 173);
display: flex;
flex-direction: row-reverse;
font-size: .9em;
}
nav a {
color: white;
text-transform: uppercase;
padding: 80px 10px 20px;
position: relative;
}
nav a:hover {
color: rgb(29, 106, 173);
background-color: rgb(240, 139, 0);
}
nav a:hover:before {
content: '';
position: absolute;
background-color: rgb(240, 139, 0);
left: 0;
bottom: -10px;
width: 100%;
height: 10px;
}
nav a:first-of-type {
order: 1;
}
1
问题非常模糊。退房https://developer.mozilla.org/en-US/
对于这个特定的问题,你可以使用CSS。比方说你有一个名为.menu-item
您的菜单项的类,你可以写
.menu-item:hover{
background:#ccccccc;
}
其中cccccc
是任何你想要的颜色。
好运
0
这是你想要的(fiddle here)。
HTML:
<div id="Hover">Hover me!</a>
CSS:
#Hover {
width: 90px;
height: 40px;
background: yellow;
}
#Hover:hover {
background: blue;
}
相关问题
- 1. 我怎样才能做到这一点:悬停图像叠加
- 2. 我怎样才能达到这个效果?
- 3. 我怎样才能排除悬停效果与CSS
- 4. 我怎样才能达到风效?
- 5. 我怎样才能实现这个图像效果iOS(看图)
- 6. 我怎样才能得到这个效果(高度)与jQuery的?
- 7. 我怎样才能让这样的
- 8. 我怎样才能让flot库悬停在点击图的圆效果?
- 9. 我怎样才能得到在Highcharts悬停的指数?
- 10. 我怎样才能得到一个JSON像这样用JavaScript
- 11. 我怎样才能达到radiobuttonlist?
- 12. 我怎样才能得到这些值
- 13. 我怎样才能得到结果?
- 14. 我怎样才能得到
- 15. 我怎样才能得到
- 16. 从左到右无限移动背景精灵?我怎样才能达到这样的效果?
- 17. 我怎样才能
- 18. 我怎样才能
- 19. 我怎样才能
- 20. 我怎样才能
- 21. 我怎样才能达到这个布局的CSS
- 22. 我怎样才能使在图像的CSS悬停在不影响图像
- 23. 我怎样才能实现像“悬停加载”功能的亚马逊?
- 24. 我怎样才能得到这样的阵列
- 25. 我怎样才能停止声音
- 26. 我怎样才能做到这一点的图像
- 27. 正则表达式 - 我怎样才能做到这一点?
- 28. 我怎样才能达到这种观点?(在列表视图)
- 29. 我怎样才能做到这个正则表达式?
- 30. 我怎样才能达到这个搜索条件?
你到底要什么样的影响? – arielnmz