все работает нормально, пока слово не оказывается в конце строки, описание выходит за пределы контейнера и портит стиль.
Мне бы хотелось Чтобы решить эту проблему, возможно, поле может перемещаться влево, а не вправо, если содержимое слишком велико, или, возможно, есть способ сохранить элемент в пределах ширины абзаца.
Код: Выделить всё
.glossary_description {
padding: 5px;
position: absolute;
background-color: white;
font-size: 0.8rem;
border: 1px solid #ccc;
padding: 10px;
width: auto;
z-index: 1;
}
.glossary_container {
width: 100%;
position: relative;
}Код: Выделить всё
Imprisoned human rights defender Khalid al-Omair joined Waleed Abu Al-Khair on protest protest hunger -Loremipsumdolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborumstrike confirmed in protest of solitary strike
Подробнее здесь: [url]https://stackoverflow.com/questions/78408304/absolutely-positioned-element-goes-out-of-screen[/url]
Мобильная версия