我有两个div,其中一个固定在顶部,当第二个div接触它时,我想为固定的div显示边框颜色,就像雅虎所做的那样。以下是实例:
。这里是代码效果:
。
有没有使用CSS或jQuery的方法来实现它?
![enter image description here](https://istack.dev59.com/4wNxG.webp)
![enter image description here](https://istack.dev59.com/jZtqw.webp)
<div class="container">
<div class="header"></div>
<div class="content"></div>
</div>
.containter{
width:700px;
margin:0 auto;
}
.header{
height:50px;
width:100%;
position:fixed;
top:0;
left:0;
background:yellow;
}
.content{
min-height:500px
width:100%;
background:red;
}
有没有使用CSS或jQuery的方法来实现它?