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>

 

相关文章:

  • 2022-01-20
猜你喜欢
  • 2021-12-15
  • 2021-11-22
  • 2022-02-28
  • 2022-03-02
相关资源
相似解决方案