0

Есть три блока, в блоке 2 находится input type="file" с таким же размером как и блок 2. Но при клике на блок 3 открывается окно выбора файлов. http://jsfiddle.net/m3atS/

.hover {
    height: 23px;
    padding: 8px 8px 8px 4px;
    width: 69px;
}
.edit {
    background: yellow;
    height: 23px;
    width: 23px;
    float: left;
}
.input {
    background: green;
    height: 23px;
    width: 23px;
    float: left;
}
input {
    height: 23px;
    width: 23px;
    opacity: 0;
    position: absolute;
    cursor: pointer;
}
.remove {
    background: red;
    height: 23px;
    width: 23px;
    float: right;
    cursor: pointer;
}
<div class="hover">
    <div class="edit">1</div>
    <div class="input">2
        <input type="file" />
    </div>
    <div class="remove" title="Удалить">3</div>
</div>

1 ответ 1

1

Теперь ОК.

.hover {
    height: 23px;
    padding: 8px 8px 8px 4px;
    width: 69px;
}
.edit {
    background: yellow;
    height: 23px;
    width: 23px;
    float: left;
}
.input {
    position: relative;
    background: green;
    height: 23px;
    width: 23px;
    float: left;
}
input {
    float: left;
    position: absolute;
    left: 0;
    top: 0;
    height: 23px;
    width: 23px;
    opacity: 0;
    cursor: pointer;
}
.remove {
    background: red;
    height: 23px;
    width: 23px;
    float: right;
    cursor: pointer;
}
<div class="hover">
    <div class="edit">1</div>
    <div class="input">2
        <input type="file" />
    </div>
    <div class="remove" title="Удалить">3</div>
</div>

1
  • разницы нет
    – TANKIST
    25 фев 2014 в 16:49

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.