Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Titre du document</title> <style> input[type=text] { width: 100px; -webkit-transition: width .2s ease-in-out; -moz-transition: width .2s ease-in-out; -o-transition: width .2s ease-in-out; transition: width .2s ease-in-out; } input[type=text]:focus { width: 150px; background-color: #eee; } </style> </head> <body> <h2>Exemple du sélecteur :focus</h2> <form> <label for="search">Recherche:</label> <input type="text" name="search" id="search"> </form> </body> </html>