EN
CSS - remove outline on focus around text input
3 points
In this article, we would like to show you how to remove the outline on focus around text input using CSS.
Quick solution:
xxxxxxxxxx
1
input:focus, textarea:focus {
2
outline: none;
3
}
In this example, we present how to remove an outline from the input element on focus using :focus
CSS pseudo-class with the outline
property set to none
.
xxxxxxxxxx
1
2
<html>
3
<head>
4
<style>
5
6
textarea:focus, input:focus {
7
outline: none;
8
}
9
10
</style>
11
</head>
12
<body>
13
<div>Get focus on text input below:</div>
14
<br />
15
<input type="text" />
16
<br /><br />
17
<textarea></textarea>
18
</body>
19
</html>