CSS :focus Selector

HTML Code

<!DOCTYPE html>
<html>
<head>
<style>
input:focus {
background-color: yellow;
}
</style>
</head>
<body>

<p>Click inside the text fields to see a yellow background:</p>

<form>
First name: <input type=”text” name=”firstname”><br>
Last name: <input type=”text” name=”lastname”>
</form>

</body>
</html>

HTML View

Click inside the text fields to see a yellow background:

First name:
Last name:

If you want to join my online or offline graphic designing course than just call me - 9334029817

Related Posts

Leave a Reply

Open chat