I made a very basic layout.
HTML
<div id="container">
<div id="logocontainer">
</div>
<div id="navigationcontainer">
</div>
<div id="textcontainer">
</div>
<div id="sidebarcontainer">
TEXTTEXTEXTTEXTTEXTEXTTEXTTEXTEXTTEXTTEXTEXTTEXTTEXTEXT.
</div>
</div>
CSS
* {
margin:0;
padding:0;
}
#container {
margin:0px auto;
width:600px;
height:1000px;
background:red;
}
#logocontainer {
float:left;
width:50%;
height:15%;
background:green;
}
#navigationcontainer {
float:right;
width:50%;
height:15%;
background:orange;
}
#textcontainer {
margin:10px;
float:left;
width:70%;
height:83.2%;
background:purple;
}
#sidebarcontainer {
margin:10px;
float:right;
width:23.33%;
background:yellow;
}
The text inside is flowing outside its boundaries even though I set a margin for the div.
Can someone tell me what the problem is?
Thanks,
SenileSage.
Most browsers don’t know how to break words that are so long, you have to give it a bit of help.
Add
word-break:break-all;to the#sidebarcontainer. Here is some more info on it on W3Schools.