Get your own website Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<head>
<style>
input:focus {
  background-color: yellow;
  width: 250px;
}
</style>
</head>
<body>
<h1>Demo of :focus</h1>
<p>Click inside (or tab to) the input fields to change background color and width:</p>
<form>
<label for="name">Name: </label><br>
<input id="name" name="name" type="text" /><br>
<label for="email">Email: </label><br>
<input id="email" name="email" type="email" /><br>
<label for="country">Country: </label><br>
<input id="country" name="country" type="text" />
</form>
</body>
</html>