CSS3新增的选择器

时间:2020-03-22 15:55:53   收藏:0   阅读:92

1. 层次选择器

2.属性选择器   [属性名]

3.过滤选择器:   :过滤条件

 

input标签中常用的选择器

<style type="text/css">
        /*input[type="text"]:enabled{
            background-color: #ffff00;
        }*/

        /*input[type="text"]:disabled{
            background: pink; 
        }*/

        /*input:required{
            background: #ff5aba; 
        }*/

        /*input:read-only{
            background: blue; 
        }*/

        /*::selection{
            color: red; 
        }*/
    </style>
</head>
<body>
    <form action="#" name="myform" method="get">
        name: <input type="text" name="xiaohua"><br>
        country: <input type="text" disabled="disabled" value="china"><br>
        <input type="radio" checked="checked" value="male"><br>
        <input type="radio" value="female"><br>
        
        <p>普通的input元素:<br><input value="hello"></p>

        <p>只读的input元素:<br><input readonly="" value="hello"></p>
        
        <div>这是div元素的文本:</div>
        <input type="number" min="1" max="10" value="6">
        <p>可选择的input元素: <br><input type="text"></p>

        <p>必填的input元素: <br><input required type="text"></p>
        
        <input type="email" value="w1418899@163.com">
    </form>
</body>
</html>

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!