File Upload Button Styling
I came across an article that said you can actually style the file upload button, so I decided to apply styling to my new File upload project.
As it turns out, this is quite easy:
input[type=file]::file-selector-button {
border: 2px solid #6c5ce7;
padding: .2em .4em;
border-radius: .2em;
background-color: #a29bfe;
transition: 1s;
}
input[type=file]::file-selector-button:hover {
background-color: #81ecec;
border: 2px solid #00cec9;
}
As you can see you just use the input[type=file] CSS selector to select the upload button. Once you have the element selected, just like any other HTML element, you apply your styling.
Comments
Post a Comment