<input type = "file"> Problemy pozycjonowania w IE11 przeglądarce
#upload-file-container {
width: 50px;
height: auto;
overflow: hidden;
}
#upload-file-container input {
position: absolute;
top: 0;
right: 0;
margin: 0;
border: solid transparent;
border-width: 0 0 100px 200px;
opacity: 0.0;
filter: alpha(opacity=100);
-o-transform: translate(250px, -50px) scale(1);
-moz-transform: translate(-300px, 0) scale(4);
direction: ltr;
cursor: pointer;
}
.buttonText {
color: #FFFFFF;
letter-spacing: normal;
font-family: Arial, sans-serif;
font-weight: bold;
font-variant: normal;
font-size: 11pt font-style: normal;
text-decoration: none;
text-transform: none;
width: 20px;
}
.buttonSpace {
height: 23px;
width: 20;
background-image: url(/portal/images/clearpixel.gif);
}
.buttonRegHead {
height: 23px;
width: 7px;
padding: 0;
margin: 0;
background-image: url(/DIPAPWebAppln/images/button_regular_head.gif);
background-repeat: no-repeat;
}
.buttonRegBody {
height: 23px;
padding: 0;
margin: 0;
background-image: url(/DIPAPWebAppln/images/button_regular_body.gif);
background-repeat: repeat-x;
}
.buttonRegTail {
height: 23px;
width: 7px;
padding: 0;
margin: 0;
background-image: url(/DIPAPWebAppln/images/button_regular_tail.gif);
background-repeat: no-repeat;
}
<html>
<table>
<tr>
<td align="left" nowrap class="formLabel">IMAGE1:<font color="red">*</font>
</td>
<TD>
<table border=0 cellspacing=0 cellpadding=0>
<tr>
<td class='buttonSpace'> </td>
<td class='buttonRegHead'> </td>
<td class='buttonRegBody'>
<div class="buttonText" id="upload-file-container">Browse
<input type="file" name="realfile1" id="realfile1" onChange="if(validate())preview(this, '1');return true;" />
</div>
</td>
<td class='buttonRegTail'> </td>
</tr>
</table>
</TD>
</tr>
</table>
</html>
Mam aplikację internetową z wieloma wejściami plików. Ukryłem wszystkie elementy plików i umieściłem przycisk. Działa to poprawnie w przeglądarkach IE8 do IE10. Ale nie w IE11. Poniżej znajduje się mój kod Snippet:
<style>
#upload-file-container {
width:50px;
height: auto;
overflow: hidden;
}
#upload-file-container input {
position: absolute;
top: 0; right: 0; margin: 0;
border: solid transparent;
border-width: 0 0 100px 200px;
opacity: 0.0;
filter: alpha(opacity=0);
-o-transform: translate(250px, -50px) scale(1);
-moz-transform: translate(-300px, 0) scale(4);
direction: ltr;
cursor: pointer;
}
.buttonText {
color: #FFFFFF;
letter-spacing: normal;
font-family: Arial, sans-serif;
font-weight: bold;
font-variant: normal;
font-size: 11pt
font-style: normal;
text-decoration: none;
text-transform: none;
width: 20px;
}
</style>
<table border=0 cellspacing=0 cellpadding=0>
<tr>
<td class='buttonSpace'> </td>
<td class='buttonRegHead'> </td>
<td class='buttonRegBody'>
<div class="buttonText" id="upload-file-container">
<%=DipapDictionary.translate(request,"Browse")%>
<input type="file" name="realfile1" id="realfile1" onChange="if(validate())preview(this, '1');return true;"/>
</div>
<td class='buttonRegTail'> </td>
</tr>
</table>
Działa poprawnie w przeglądarce IE10. Wejście do pliku przechodzi nad przyciskiem, a przycisk staje się klikalny. Tak, jestem w stanie przeglądać plik. Jednak w przeglądarce IE11 element pliku html nadchodzi gdzieś na górze strony, a przycisk przeglądania nie jest klikalny.
Czy możesz udostępnić działające skrzypce? –
@DeepakYadav: Dodano mały fragment kodu. proszę dać mi znać, jeśli chcesz uzyskać więcej informacji –
Brakuje średnika po linii: 'font-size: 11pt' Nie mam pojęcia, czy to kryje się za tym problemem, ale z pewnością nie pomoże. –