Ich mache eine Server-Status-Site für meine Gaming-Community. Ich stolperte über ein Problem mit einer Box, die mit dem Text nicht die Höhe änderte.Stellen Sie die Breite einer Box je nach Text ein
Und das ist mein CSS im Moment:
.explain_container {
border: 1px solid #BFC4C7;
background: white;
width: 1000px;
height: 120px;
position: relative;
font-size: 14px;
color: #5A5A5A;
}
.explain_text {
width: 900px;
height: 50px;
position: relative;
top: 50px;
margin-left: auto;
margin-right: auto;
}
Und das ist mein HTML:
<div class="explain_container">
<div class="explain_text">
Text that's longer should extend the height of the box.
Text that's longer should extend the height of the box.
Text that's longer should extend the height of the box.
Text that's longer should extend the height of the box.
Text that's longer should extend the height of the box.
Text that's longer should extend the height of the box.
Text that's longer should extend the height of the box.
Text that's longer should extend the height of the box.
Text that's longer should extend the height of the box.
Text that's longer should extend the height of the box.
Text that's longer should extend the height of the box.
Text that's longer should extend the height of the box.
Text that's longer should extend the height of the box.
Text that's longer should extend the height of the box.
Text that's longer should extend the height of the box.
Text that's longer should extend the height of the box.
Text that's longer should extend the height of the box.
Text that's longer should extend the height of the box.
Text that's longer should extend the height of the box.
Text that's longer should extend the height of the box.
</div>
</div>
Es gibt angeblich über 50px Rand an allen 4 Seiten sein. Wie kann ich das beheben?
Warum kein scrollbaren ein? Scrollable scheint mir vernünftiger. –