css匹配type属性值为text的input元素
分类:实例代码
分享一段代码实例,它实现了匹配type属性值为text的input元素。
代码实例如下:
<!doctype html> <html> <head> <meta charset="utf-8"> <meta name="author" content="http://www.pipipi.net/" /> <title>前端教程网</title> <style type="text/css"> input { width:180px; height:30px; } input[type=text] { color:green; } </style> </head> <body> <input type="text" value="前端教程网"/> <input type="url" value="www.pipipi.net"/> </body> </html>
使用属性选择器即可实现,具体可以参阅CSS E[att="val"]一章节。
css匹配type属性值为text的input元素,这样的场景在实际项目中还是用的比较多的,关于css匹配type属性值为text的input元素就介绍到这了。
css匹配type属性值为text的input元素属于前端实例代码,有关更多实例代码大家可以查看。
一线大厂高级前端编写,前端初中阶面试题,帮助初学者应聘,需要联系微信:javadudu