Set the background color of <input> elements that are in focus (clicked or active), to "pink". - HTML CSS CSS

HTML CSS examples for CSS:Quiz

Description

Set the background color of <input> elements that are in focus (clicked or active), to "pink".

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<style>
input:focus {<!-- ww w . j a v  a2  s. c  om-->
    background-color: pink;
}
</style>
</head>
<body>

<form action="/action_page.php" method="get">
  First name: <input type="text" name="fname"><br>
  Last name: <input type="text" name="lname"><br>
  <input type="submit" value="Submit">
</form>

</body>
</html>

Related Tutorials