CSS - 2 div's with centred content within a div

Associate
Joined
13 Jan 2007
Posts
2,424
Location
Belfast,Northern Ireland
Love the title a lot!

Anyway yes the above is what I am attempting to achieve but not having much luck. I dont want to float the inner left and right as I want the content inside them to be centred. I want them to be constrained to the inner containers boundries too. Got close by adding a clearing div but not quite happening still. I saw mentions of overflow:hidden fixing this, they lied!


Here is the html:

Code:
<div id="outer-container">  
 	<div id="inner-container">
              <div id="header">  
  
           
              </div>  <!--end header-->
 
              <div id="inner-left">
              </div> <!--end inner-left-->
              <div id="inner-right">
              </div> <!--end inner-right-->
 
        </div>  <!--end inner-container-->
</div>  <!--end outer-container-->

CSS:
Code:
#outer-container {
	width:950px;  
     margin:0 auto;  
	overflow:hidden;
	border:solid 1px red;
		   }
		   
#inner-container {
	width:771px;  
     margin:0 auto;  	 
	overflow:hidden;
	min-height:800px;
	border:solid 1px yellow;
		   }
		   
#inner-left {
	width:305px; 
     margin:0 auto;  	 
	overflow:hidden;
	min-height:800px;
	border:solid 1px purple;
		   }
		   
#inner-right {
	width:305px; 
     margin:0 auto;  	 
	overflow:hidden;
	min-height:800px;
	border:solid 1px green;
		   }
 
is it not thought of as horrid to use that for positioning? Surely there will be issues with IE? Will give it a go now anyways!

*Nah initially the inner left & right divs set up correctly and work for just text. However when i stick in the other divs/content boxes it goes mental and inner right goes under inner left
 
Last edited:
Sorted, seems I am very much on track with my retarded ways these days. Giving css a rest for the day in favour of php & sql which hopefully I will mess up less!

Thanks all for the help and thanks FabienO for that plugin, I'd never heard of it
 
yeah I hadnt used the validator as a debugging technique, that was pretty dumb of me, considering the size of the files now I cant really expect to spot missing tags too easily.
 
On a side note it is incredibly grim being inside working on this when the weather outside is immense :(

If I dont get my first I will go insane lol
 
Thanks mate much appreciated, final year of my bachelors. Have a 76 average including the first semester of this year so I *should* be fine, just need to force the head down and keep working away
 
Back
Top Bottom