Home  >  Q&A  >  body text

javascript - The input file is transparent and covered with other buttons. How to solve the problem when the cursor flashes when clicked in IE?

<form action="" id="formPathfile" name="formPathfile" method="post" enctype="multipart/form-data" onsubmit="return false">

    <input type="hidden" id="itemid" name="itemid" value=""/>
    <input type="button" id="pfle" style="width:100px;  position: absolute;
    left: 0;top:0" value="Browse Flie" onchange="return false">    
    <input type="file" id="pfile" value="" name="pfile" style="margin-top:-8px; filter:alpha(opacity=0);
opacity:0;" onchange=""  />
    
</form>

迷茫迷茫2681 days ago755

reply all(1)I'll reply

  • PHP中文网

    PHP中文网2017-06-17 09:17:25

    Cause

    Why does the cursor flash in IE? I reproduced your code: as shown

    Solution ideas

    The solution I will talk about here is mainly to use relative and absolute or CSS layers to solve it. Set the button to be displayed to position: relative; then set the upload button to position: absolute; and the upload button puts the layer at Display the upper layer of the button eg: z-index:999

    Related information

    I have also encountered the beautification of upload buttons before: portal input upload button beautification

    reply
    0
  • Cancelreply