誰做過這種效果
這是我寫的,使用border-right:1px solid #eee;border-bottom:1px solid #eee;滑鼠懸浮時ul li:hover{border-color:# ed9639;}怎麼讓左邊也有一像素紅框
淡淡烟草味2017-07-05 11:06:45
看起來好像每個項題主都只有右邊跟下邊?
我感覺改成每個項目都有左邊跟下邊,hover的時候再透過設定相鄰元素的左邊顏色如何?
範例:
*{
box-sizing:border-box;
}
.wrap{
width:300px;
}
.item{
width:75px;
float:left;
text-align:center;
border:1px solid #eee;
border-right-width:0;
}
.item:last-child{
border-right-width:1px;
}
.item:hover{
border-left-color:red;
border-bottom-color:yellow;
}
.item:hover + .item{
border-left:1px solid yellow;
}
.item:last-child:hover{
border-right:1px solid yellow;
}
<p class="wrap">
<p class="item">
hello
</p>
<p class="item">
hello
</p>
<p class="item">
hello
</p>
<p class="item">
hello
</p>
</p>
http://runjs.cn/detail/ibxy9qab