Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The file upload field cannot be styled (very much) in CSS, and cannot be scripted from JS (enough to make a surrogate control actually work). There are somewhat-sensible security reasons why this is the case, though you might argue they have been taken a bit too far.</p> <p>More generally, it's difficult to style a file upload field anyway, because you don't know what a file upload field looks like. It's all up to the browser. Maybe you'll get a text field on the left and a ‘Browse’ button/popup on the right (in that case, which part does the <code>border</code> apply to? Or around both?); maybe you'll get just a popup on the left and a status icon/label on the right (like in Safari); maybe you'll just get a drag-and-drop field. Or something else. It's totally out of your control.</p> <p>Most ‘professional’ sites do one of two things:</p> <ol> <li><p>Don't care about it, just use a plain unstyled file upload field. Perhaps in a pop-up div when you request to upload (so at least it's not being inconsistent on-screen at all times).</p></li> <li><p>Use a progressive-enhancement technique to replace the HTML file upload with an alternative uploader based around Flash (or less commonly Java or Silverlight; in the future we'll have more browsers with support for HTML5 drag-and-drop).</p></li> </ol> <p>There is a hack detailed <a href="http://www.quirksmode.org/dom/inputfile.html" rel="nofollow">here</a> that works by making the real file upload control invisible and positioning it over the top of a stylable display control. But it's really pretty unreliable, depending on a guess of what size the browser's file upload control will be and what bits will respond to a click. It's bad for accessibility (doesn't respond to keyboard correctly), bad for usability (it doesn't even line up on my perfectly normal Firefox) and <strong>I wouldn't recommend using it at all</strong>.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload