Garindan
03-12-2009, 01:45 PM
Hi all, i have tried and i cant seem to get this one to work.
I have a container on a page with three div boxes in it all floated left. I am using it to display three lists side by side.
The container is #categories, then the three boxes share the .categorybox class, and then theres a list in each box.
The trouble is the middle list has one more item in it than the other two so to make it neater i wanted to vertically center the lists inside the box, but i cant get it to work.
Here's the code:-
HTML
<div id="categories">
<div class="categorybox">
<ul>
<li>Decking</li>
<li>Garden Makeovers</li>
<li>Patio/Paving</li>
<li>Fencing</li>
</ul>
</div>
<div class="categorybox">
<ul>
<li>Lawns - Turfing/Treatment</li>
<li>Driveways</li>
<li>Garden Design</li>
<li>Pressure Wash/Sealing</li>
<li>Garden/Property Maintenance</li>
</ul>
</div>
<div class="categorybox">
<ul>
<li>Ponds</li>
<li>Tree/Hedge Work</li>
<li>Clearance</li>
<li>Walling</li>
</ul>
</div>
</div>
CSS
#categories {
width: 930px;
}
#categories ul {
margin: 0;
padding: 0;
}
.categorybox {
float: left;
width: 288px;
height: 200px;
border:solid 1px silver;
padding: 5px;
margin-left: 5px;
margin-right: 5px;
text-align: center;
font-size: 16px;
font-weight: bold;
color: #14612F;
line-height: 200%;
}
Many thanks for any help! :thumbsup: :)
I have a container on a page with three div boxes in it all floated left. I am using it to display three lists side by side.
The container is #categories, then the three boxes share the .categorybox class, and then theres a list in each box.
The trouble is the middle list has one more item in it than the other two so to make it neater i wanted to vertically center the lists inside the box, but i cant get it to work.
Here's the code:-
HTML
<div id="categories">
<div class="categorybox">
<ul>
<li>Decking</li>
<li>Garden Makeovers</li>
<li>Patio/Paving</li>
<li>Fencing</li>
</ul>
</div>
<div class="categorybox">
<ul>
<li>Lawns - Turfing/Treatment</li>
<li>Driveways</li>
<li>Garden Design</li>
<li>Pressure Wash/Sealing</li>
<li>Garden/Property Maintenance</li>
</ul>
</div>
<div class="categorybox">
<ul>
<li>Ponds</li>
<li>Tree/Hedge Work</li>
<li>Clearance</li>
<li>Walling</li>
</ul>
</div>
</div>
CSS
#categories {
width: 930px;
}
#categories ul {
margin: 0;
padding: 0;
}
.categorybox {
float: left;
width: 288px;
height: 200px;
border:solid 1px silver;
padding: 5px;
margin-left: 5px;
margin-right: 5px;
text-align: center;
font-size: 16px;
font-weight: bold;
color: #14612F;
line-height: 200%;
}
Many thanks for any help! :thumbsup: :)