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:
input {
background: yellow;
}
Practical example
In this example, we present how to use CSS type selector to style all input elements on the web page.
// ONLINE-RUNNER:browser;
<!doctype html>
<html>
<head>
<style>
input {
background: #ffe973;
}
</style>
</head>
<body>
<input type="text" placeholder="username" />
<input type="password" placeholder="password" />
</body>
</html>
Note:
To style only inputs of specific type, go to the articles from See also section below.