效果圖
1- 改變input輸入框顏色
border: 1px solid pink;
2-改變input輸入內(nèi)容顏色
color: pink;
全部代碼文章來源地址http://www.zghlxwxcb.cn/news/detail-521080.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>css新增屬性值</title>
<style>
/* 必須是input元素;但是同時(shí)也具備input元素有value這個(gè)值 用中括號(hào)[]*/
/* input[value]{
color:red
} */
*{
padding: 0;
margin: 0;
}
input[type=password]{
color: pink;
border: 1px solid pink;
outline: none;
}
</style>
</head>
<body>
<!--1.利用屬性選擇器就可以不用借助于類或者id選擇器 -->
<!-- <input type="text" value="請(qǐng)輸入你喜歡的人">
<input type="text"> -->
<!-- 2.屬性選擇器還可以選擇屬性=值的某些元素 -->
<input type="text">
<input type="password">
</body>
</html>```
文章來源:http://www.zghlxwxcb.cn/news/detail-521080.html
到了這里,關(guān)于input輸入框改變顏色 以及input輸入內(nèi)容更改顏色的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!