0

Есть textarea и справа от него div, заполняемый другими div’ами. В Chrome на ПК всё отлично (и в предпросмотре с настройками iPad в режиме разработчика), а в браузерах на iOS второй div (правый который) явно путает берега, равняясь почему-то на вложенные в него элементы относительно края textarea. Что с ним не так?

.ch {
    display: block;
    position: fixed;
    z-index: 1;
    padding-top: 100px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0,0,0);
    background-color: rgba(0,0,0,0.4);
}

.ch-content {
    background-color: #fefefe;
    margin: auto;
    padding: 10px;
    border: 1px solid #888;
    width: 60%;
    height:60%;
}

.closech {
    color: #aaaaaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.closech:hover,
.closech:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

textarea, input {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

label {
  display: block;
  margin-bottom: 4px;
  padding-left: 15px;
  text-indent: -15px;
}

.chattext {
  width:75%;
  height:70%;
  overflow-y:auto;
  background:ghostwhite;
  display:inline-block;
}

.ulist {
  width:15%;
  height:70%;
  overflow-y:auto;
  background:oldlace;
  display:inline-block;
  text-overflow:ellipsis;
  white-space:nowrap;
}
<div id='ch' class='ch' >
    <div class='ch-content'>
        <span class='closech'>&times;</span>
        <label>Example:</label>
        <div class="chattext"></div><div class="ulist"><div>TEST</div><div>TEST</div></div>
    </div>
</div>
    

введите сюда описание изображения

1 ответ 1

3

При использовании inline-block всегда указывай явно vertical-align

.ch {
    display: block;
    position: fixed;
    z-index: 1;
    padding-top: 100px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0,0,0);
    background-color: rgba(0,0,0,0.4);
}

.ch-content {
    background-color: #fefefe;
    margin: auto;
    padding: 10px;
    border: 1px solid #888;
    width: 60%;
    height:60%;
}

.closech {
    color: #aaaaaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.closech:hover,
.closech:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

textarea, input {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

label {
  display: block;
  margin-bottom: 4px;
  padding-left: 15px;
  text-indent: -15px;
}

.chattext {
  width:75%;
  height:70%;
  overflow-y:auto;
  background:ghostwhite;
  display:inline-block;
  vertical-align: top /* <<<<<<<<<<<<<<<<< */
}

.ulist {
  width:15%;
  height:70%;
  overflow-y:auto;
  background:oldlace;
  display:inline-block;
  text-overflow:ellipsis;
  white-space:nowrap;
  vertical-align: top /* <<<<<<<<<<<<<<<<< */
}
<div id='ch' class='ch' >
    <div class='ch-content'>
        <span class='closech'>&times;</span>
        <label>Example:</label>
        <div class="chattext"></div><div class="ulist"><div>TEST</div><div>TEST</div></div>
    </div>
</div>
    

Ваш ответ

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

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