• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

Frage Inhalt in einer Box unten zentrieren!

nicosammito

Neues Mitglied
Hallo,
Ich habe ein Problem!
Ich möchte gerne das der Inhalt bzw. der Text in einer Box unten zentriert ist und nicht oben.
Das heißt wenn mehr Inhalt bzw. mehr Text hinzukommt wird der obere Teil eine Zeile nach oben verschoben so das der hinzugefügte Teil Platz findet.
Hier der Code:
HTML:
<!DOCTYPE html>
<html>
<head>
<style>
div {
    background-color: lightgrey;
    width: 300px;
    border: 25px solid green;
    padding: 25px;
    margin: 25px;
    height: 300px;
}
</style>
</head>
<body>

<h2>Demonstrating the Box Model</h2>

<p>The CSS box model is essentially a box that wraps around every HTML element. It consists of: borders, padding, margins, and the actual content.</p>

<div>This text is the actual content of the box. We have added a 25px padding, 25px margin and a 25px green border. 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.</div>

</body>
</html>
 
Werbung:
Zurück
Oben