Reputation: 3938
I have two divs where the text inside them will often change. When the contents inside the two divs becomes two wide for the container div I would like the left div to wrap the text to a new line.
This is my desired results:
<html>
<head>
<style type="text/css">
#header {
position:relative;
height: 100px;
width:150PX;
}
#leftdiv {
position: absolute;
float:left;
left:0px;
bottom:0px;
font-size: 10px;
}
#rightdiv {
position:absolute;
float:right;
right:0px;
bottom:0px;
font-size: 10px;
}
</style>
</head>
<body>
<div id="header">
<div id="leftdiv">Content in Left Div</div>
<div id="rightdiv">Content in Right More</div>
</div>
</body>
</html>
Upvotes: 4
Views: 14766
Reputation: 7133
Use this word-wrap: break-word;
Assign all those divs in which you want text to wrap a class and then style that class using word-wrap: break-word;
Upvotes: 5