I've got this code:
<html>
<head>
<style type="text/css">
body {
text-align: center;
}
#content {
width: 60em;
margin: 0, auto;
background-color: #CCC;
}
</style>
</head>
<body>
<center>
<div id="content">kdsjlglkdfjgolksdjflgojsdfsdoljfglsdfghsdkjfgkdhfgkhlglkdfjgolksdjflgojsdfsdoljfglsdfghsdkjfgkdhfgklglkdfjgolksdjflgojsdfsdoljfglsdfghsdkjfgkdhfgklglkdfjgolksdjflgojsdfsdoljfglsdfghsdkjfgkdhfgklglkdfjgolksdjflgojsdfsdoljfglsdfghsdkjfgkdhfgklglkdfjgolksdjflgojsdfsdoljfglsdfghsdkjfgkdhfgklglkdfjgolksdjflgojsdfsdoljfglsdfghsdkjfgkdhfgklglkdfjgolksdjflgojsdfsdoljfglsdfghsdkjfgkdhfgkkjdghkdsfjgksdjfhg</div>
</center>
</body>
</html>
Why does the text not stay inside the div, but go in a single line until it ends? I want it to have line breaks relative to the div it's inside. How can I do this?
Because word wrapping occurs between words.
At least by default. The word-break property can change that in some browsers, but you should avoid having nonsensical 'words' in the content.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With