When I select a file, most browsers (i.e. Chro...">

Safari displaying image in input file element

I have a file upload item

<input type="file">

When I select a file, most browsers (i.e. Chrome and FF) display the image name. However, Safari shows a thumbnail. Bad Safari!

My ultimate goal, which works everywhere except Safari, is to create a custom download button using the psudo element. After selecting the image, a tiny sketch appears in the center of my button, which I cannot get rid of.

To solve the problem:

Safari: Safari shows thumbnail

Other: Other browsers not showing thumbnails

Purpose after adding font size: 0 ;: Button only

To wrap it here, the final product I am trying to prevent is: Leave image

+4
source share
1 answer

, 0, visibility: hidden;

, " " , .

input[type="file"] {
  visibility: hidden;
}
0

Source: https://habr.com/ru/post/1614656/


All Articles