拓展

作者: 尘榆骡厌 | 来源:发表于2017-09-25 17:55 被阅读0次

1.拓展选择器

1.选择第一个子元素
    div>p:first-child{}    /*选择div里面第一个子元素*/
2.选择最后一个子元素
    div>p:last-child{}     /*选择div里面最后一个子元素*/
3.选择某一个子元素
    ul li:nth-child(index)  even偶数 odd奇数
4.不选中某个
    :not(selector)//:nth-child(index) 

2.Emmet语法

<!--ul>li.item*4>a[href=#]{首页}-->
//生成
<ul>
    <li class="item"><a href="#">首页</a></li>
    <li class="item"><a href="#">首页</a></li>
    <li class="item"><a href="#">首页</a></li>
    <li class="item"><a href="#">首页</a></li>
</ul>

3.样式写出三角形

例如:
    <style>
        .sanjiao{
            display: block;
            height: 0;
            width: 0;
            border: 20px solid transparent;
            border-bottom-color: red;
        }
    </style>
</head>
<body>
<span class="sanjiao"></span>
</body>
其中改变边框的方向就可以改变三角的朝向。

相关文章

网友评论

      本文标题:拓展

      本文链接:https://www.haomeiwen.com/subject/bfpdextx.html