CSS ::file-selector-button Pseudo-element
Example
Style <input type="file"> buttons:
::file-selector-button {
border: 2px solid black;
padding: 5px 10px;
border-radius: 5px;
background-color:
lightgreen;
}
Try it Yourself »
More "Try it Yourself" examples below.
Definition and Usage
The ::file-selector-button
pseudo-element selects any button of
type <input type="file">.
Version: | CSS Pseudo-elements Module Level 4 |
---|
Browser Support
The numbers in the table specifies the first browser version that fully supports the pseudo-element.
Pseudo-element | |||||
---|---|---|---|---|---|
::file-selector-button | 89 | 89 | 82 | 14.1 | 75 |
CSS Syntax
::file-selector-button {
css declarations;
}
More Examples
Example
Style <input type="file"> buttons, and add a hover effect:
::file-selector-button {
border: 2px solid black;
padding: 5px 10px;
border-radius: 5px;
background-color:
lightgreen;
}
::file-selector-button:hover
{
background-color: salmon;
cursor: pointer;
}
Try it Yourself »
Related Pages
CSS tutorial: CSS Pseudo-elements