<!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>