first-child 和last-child是伪类选择器,选择第一个和选择最后一个子元素
现在实现下面的效果
class="menuico">
.menuico span {
display: block;
width: 21px;
height: 2px;
background-color: #666;
}
.menuico span:first-child {
margin-top: -6px;
}
.menuico span:last-child {
margin-top: 6px;
}
Original: https://www.cnblogs.com/taoshihan/p/16436260.html
Author: 大灰狼小红帽
Title: [CSS] css使用first-child 和last-child 实现三条杠效果
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/553611/
转载文章受原作者版权保护。转载请注明原作者出处!