Click here to Skip to main content
15,912,475 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have made an html page. The Width of the page is 1000px. I layout the page with a sidebar and a mainarea.
the CSS Style for both is as under;

#sidebar
{
   width:300px;
   background-color:#000;
   float:left;
}

#mainarea
{
   width:700px;
   background-color:#C30;
   float:left;

}


I don't know how much height will require for the mainarea, because the contents of the mainarea will be generated dynamically.
My Question is how I can ensure that the sidebar height must end up with the mainarea height.

I mean I want the sidebar as long, as the mainarea. I hope you have understood my point.
Posted

1 solution

use this css you can change margin as per your requirement


CSS
#sidebar
{
   width:300px;
   background-color:#000;
   float:left;
   height : auto;
}

#mainarea
{
   width:700px;
   background-color:#C30;
   float:left;
   margin:10px;

}


if you like this than pls appreciate and always help others from your knowledge.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900