CSS匹配input text文本框

快乐打工仔 分类:实例代码

CSS匹配input text文本框属于前端实例代码,有关更多实例代码大家可以查看

大家都知道input的标签根据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"]{
  color:blue;
}
</style>
</head>
<body>
<input type="tel" value="18300258888"/>
<input type="text" value="www.pipipi.net" />
</body>
</html>

上面的代码可以单独设置文本框的value属性值颜色。

input[type="text"]用法参阅CSS E[att="val"]属性选择符一章节。

CSS匹配input text文本框,这样的场景在实际项目中还是用的比较多的,关于CSS匹配input text文本框就介绍到这了。

回复

我来回复
  • 暂无回复内容