This is my HTML code
<div class="container">
<div class="menu-vertical">menu-vertical</div>
<div class="mainContent">mainContent</div>
</div>
This is my CSS
.container {
border: 3px solid #666;
overflow: hidden
}
.menu-vertical {
width: 230px;
float: left;
padding: 10px;
border: 2px solid #f0f
}
.mainContent {
overflow: hidden;
padding: 30px;
border: 2px solid #00f
}
Now i want to make few div
inside mainContent
of fixed size lets say 150px
however if the mainContent
width became, lets say 650px
then i'll be having 4 div
in a row then again 4 in a row. So 4 div
means it will be of 600px
, hence i'll be having an extra 50px
of space.
Now finally what exactly i want to do is to detect this empty space and making the mainContent
max-width
to 600px`. Any trick which can do this. Javascript or something.