效果:
代码:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>否定伪类选择器</title> <style type="text/css"> .container{ margin: 100px; } .container input:not([type=text]){ color: red; } </style> </head> <body> <div class="container"> <input type="text" name="" placeholder="请输入账号"> <input type="reset" name="" value="重置"> <input type="submit" name="" value="提交"> </div> </body> </html>