How to remove outline around text input boxes in chrome using CSS

Topic: HTML / CSS« Prev|Next »

Answer: Use CSS outline property

In Google Chrome browser form controls like <input>, <textarea> and <select> highlighted with blue outline around them on focus. This is the default behavior of chrome, however if you don't like it you can easily remove this by setting their outline property to none, like this:

  • <!DOCTYPE html>
  • <html lang="en">
  • <head>
  • <meta charset="utf-8">
  • <title>Remove Input Highlighting in Chrome with CSS</title>
  • <style type="text/css">
  •     input:focus, textarea:focus, select:focus{
  •         outline: none;
  •     }
  • </style>
  • </head>
  • <body>
  •     <form>
  •         <input type="text">
  •         <hr>
  •         <textarea></textarea>
  •         <hr>
  •         <select>
  •             <option>Select</option>
  •         </select>
  •     </form>
  • </body>
  • </html>

Related FAQ

Here are some more FAQ related to this topic:

 
Close

Your Feedback:

 

We would love to hear from you! Please say something.