Saying that I have an input type="file" field. You can delete the file on this input (for example, in Firefox), rather than clicking “view” and select the file.
Now I want to tweak it a bit by changing the background color of the field when you are about to delete the file in input . I cannot use :hover , as it matches even when you are not dragging and dropping. Is there any CSS (pseudo-class) for this?
And is there a CSS way for the style to be different if the file that was dumped is not accepted, and if so? Say, if a field accepts only PNG files using accept attributes, I would make the field green if you are going to delete the PNG file on it, and red if it is a different type of file.
Is there a CSS way to do this today? Is there a planned way to do this in CSS (e.g. in future specs / in current specs, but not anywhere)?
html css css-selectors pseudo-class
Xenos
source share