问答详情
源自:5-5 CSS3背景 制作导航菜单综合练习题

伪元素设置了分割线为什么不起作用

		.nav li:before{		   border:linear-gradient(to bottom,#ccc,#cc1,#ccc) left/1px 15px no-repeat;		}        /*删除第一项和最后一项导航分隔线*/		.nav li:first-child{		   display:none;		}		.nav li:last-child{		   display:none;		}

如代码所示

提问者:虾滑咸鱼 2018-06-20 17:17

个回答

  • 秋山在此
    2018-11-13 11:19:37

    .nav li::before和.nav li:first-child::before

  • qq_夜乡晟_0
    2018-06-21 18:07:39

    .nav li:after{

       content: '';

                position: absolute; width: 1px; height: 13px; top: 18px; right: 0;

                background-image: linear-gradient(to right, rgba(255,255,255,.5), grey);

                

            }