<!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>Document</title>
<style>
input{
width: 200px;
height: 20px;
/* 要点属性1:输入框输入时文字的颜色 */
color: green;
/* 要点属性2:去除聚焦时的边框 */
outline:none;
/* 要点属性3:输入框边框 */
border: 2px solid orange;
/* 要点属性4:聚焦时光标颜色 */
caret-color: violet;
}
/* 要点属性5:兼容不同浏览器placholder提示文字的颜色 */
input::-webkit-input-placeholder { /* WebKit browsers */
color: red;
}
input:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
color: red;
}
input::-moz-placeholder { /* Mozilla Firefox 19+ */
color: red;
}
input:-ms-input-placeholder { /* Internet Explorer 10+ */
color: red;
}
/* 要点属性6:输入框聚焦时placholder文字颜色 */
input:focus::-webkit-input-placeholder{
color: blue;
}
</style>
</head>
<body>
<input type="text" placeholder="请输入内容">
</body>
</html>
注释:当输入框无边框且聚焦时无边框,要同时设置border:none;和outline:none;