EN
CSS - add outline to input on focus
0 points
In this article, we would like to show you how to add an outline to input on focus using CSS.
Quick solution:
xxxxxxxxxx
1
input:focus {
2
outline: 3px solid yellow;
3
}
In this example, we add an outline to the input element on focus using :focus
CSS pseudo-class with the outline
property.
xxxxxxxxxx
1
2
<html>
3
<head>
4
<style>
5
6
input:focus {
7
outline: 5px solid yellow;
8
}
9
10
</style>
11
</head>
12
<body>
13
<input type="text">
14
</body>
15
</html>