PDA

View Full Version : Resolved on overflow, make div adjust to text



cinek
Sep 20th, 2010, 09:13 AM
is it possible to make a div containing a text adjust to the amount of text if the text exceeds the divs size? Is it possible for the div to extend down instead of up? for some reason my div(s) are expanding up :S

this is the css

div#section1, div#section2, div#section3 {width: 260px; min-height: 380px; background-color: #ebebeb; float: left; position: relative; display: block; overflow: auto; }

and html

<div class="section1_wrapper">
<h1>some text</h1>


<div id="section1">


<div id="section1Text">

</div>


it's all closed btw - I didn't include all the closing divs

I tried adding overflow: auto to css - but it didn't make any difference

cinek
Sep 20th, 2010, 09:53 AM
1, I changed the position of the wrapper from absolute to relative. It worked, had to align the 3 boxes (divs) again. Now they adjust to overflown text, but the background does not.... even tho, I set the height property - min-height: 900px; :S - I tried adding: overflow: inherit - but no luck ;/

EDIT;

2, inside those 3 divs, I have 5 color boxes - 20px wide & high. After the divs change height, the boxes seem to stay in their original position. I have the position of the boxes set to absolute. If I change it to relative, if I enter 1 line of text, they'll move down. Is it possible to stick them to the bottom of the main div so that if it resizes in anyway, the color boxes will stay at the bottom but inside the div?