单独设置input text文本框样式
分类:实例代码
nput元素种类繁多,如果想单独设置某一种type类型的input元素的样式,那该如何做呢。
下面就以文本框为例子做一下演示,代码实例如下:
<!doctype html> <html> <head> <meta charset="utf-8"> <meta name="author" content="http://www.pipipi.net/" /> <title>前端教程网</title> <style type="text/css"> input[type="text"] { width:180px; height:30px; border:1px solid blue; } </style> </head> <body> <input type="text"> <input type="password"> </body> </html>
使用属性选择器即可实现我们的要求,参阅CSS E[att="val"]属性选择符一章节。
一线大厂高级前端编写,前端初中阶面试题,帮助初学者应聘,需要联系微信:javadudu