Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

-webkit-file-upload-button css implementation for firefox

Tags:

css

I have css implementation for <input type="file"> which styles the button and this is my code:

::-webkit-file-upload-button {
            cursor: pointer;
            margin-top: 25px;
            display: inline-block;
            padding: 6px;
            padding-right: 29px;
            padding-left: 29px;
            transition: all 1s ease;
            color: @darkGray;
            text-transform: capitalize;
            font-size: 15px;
            z-index: 1;
            position: relative;
            border-radius: 25px;
            background-color: transparent;
            border: 2px solid @red;
}

But this only works on Chrome and I would like to know how would I do it for other browsers?

like image 354
Emad Avatar asked Oct 27 '25 23:10

Emad


1 Answers

There's a standard ::file-selector-button pseudo-element now, see https://github.com/w3c/csswg-drafts/issues/5049. Firefox supports it, and future versions of Safari and Chrome will too.

like image 180
Emilio Cobos Álvarez Avatar answered Oct 30 '25 15:10

Emilio Cobos Álvarez