EN
CSS - style HTML input element
0 points
In this article, we would like to show you how to style HTML input element using CSS.
Quick solution:
xxxxxxxxxx
1
input {
2
background: yellow;
3
}
In this example, we present how to use CSS type selector to style all input
elements on the web page.
xxxxxxxxxx
1
2
<html>
3
<head>
4
<style>
5
6
input {
7
background: #ffe973;
8
}
9
10
</style>
11
</head>
12
<body>
13
<input type="text" placeholder="username" />
14
<input type="password" placeholder="password" />
15
</body>
16
</html>
Note:
To style only inputs of specific type, go to the articles from See also section below.