Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HTML
<body>
<div class="box">
	<div class="innerBox left">

</div>
</div>
<div class="box">
	<div class="innerBox center">

</div>
</div>
<div class="box">
	<div class="innerBox right">

</div>
</div>
</body>


CSS
<style>
.box{
  width:100%;
  hieght:100%;
  display:block;
  padding:4px;
  clear:both;
}
.innerBox{
  width:33%;
  height:211px;
  background-color:#ccc;
  border:1px solid #444;
}
.innerBox.left{
  float:left;
}
.innerBox.center{
  margin:auto;
}
.innerBox.right{
  float:right;
}
</style>
Posted
Updated 3-Aug-14 1:57am
v2
Comments
Abhishek Pant 3-Aug-14 7:58am    
my suggestion is to use twitter bootstrap

1 solution

Hi, To make your height constant then give same value for both min-height and max-height properties.

For Example :

C#
p
{
min-height:100px;
max-height:100px;
 }



And to make your height to change based on precentage, then go with the following example


Example :

CSS
body {
margin: 0 auto;
height: 100%;
width: 100%;
}


CSS
.header {
height: 50%;
width: 100%;
position:absolute;
border: 1px solid red;
box-sizing:border-box;
}



please click this link[^] for reference.
 
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