4

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:
This is my desired result:

<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>
bradley4
  • 3,823
  • 6
  • 34
  • 41

1 Answers1

5

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;

Vishwesh Jainkuniya
  • 2,821
  • 3
  • 18
  • 35
Andy897
  • 6,915
  • 11
  • 51
  • 86