CSS 属性选择器

CSS 属性选择器

再<style>标签内,通过选择器方法加“[]”内填入指定属性来获取标签,设置CSS样式。

<html>
<head>
    <!-- style 设置头部标签 -->
    <style>
         /*可将某个标签指定自定义属性引用*/
        input[type='xxx']{
            width: 100px;
            height: 200px;
        }
        /*可将指定class的标签内的对应属性,将其引用*/
        .c1 [type='xxx2']{
            width: 100px;
            height: 200px;
        }
    </style>
</head>
<body>
    <!-- 引用input标签的指定属性 -->
    <input type="xxx">
    <!-- 引用含有指定class类的指定属性 -->
    <input class="c1" type="xxx2">
</body>
</html>

 

posted @ 2019-02-21 14:23  kevin.Xiang  阅读(606)  评论(0编辑  收藏  举报