css input文本框获取焦点

来源:互联网 发布:网络信息安全书籍 编辑:程序博客网 时间:2024/06/09 18:29
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>Document</title><style>input , textarea{ outline:none;}input:focus , textarea:focus{border: 1px solid red;background: #ddd;}</style></head><body><from><input type="username" /><input type="pass" /><textarea name="" id="" cols="30" rows="10"></textarea></from></body></html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style>
input , textarea{
outline:none;
}
input:focus , textarea:focus{         获取焦点改变颜色
border: 1px solid red;
background: #ddd;
}
</style>
</head>
<body>
<from>
<input type="username" />
<input type="pass" />
<textarea name="" id="" cols="30" rows="10"></textarea>
</from>
</body>
</html>

0 0