I have the following
HTML:
<div id="filter-menu">
<div class="filter-item home selected"></div>
<div class="filter-item animals"></div>
<div class="filter-item ancient"></div>
<div class="filter-item energy"></div>
<div class="filter-item env"></div>
<div class="filter-item travel"></div>
</div>
CSS:
#filter-menu{
width: 505px;
height: 40px;
float: left;
margin-left: 10px;
margin-top: 3px;
}
#filter-menu .filter-item{
float: left;
height: 38px;
width: 84px;
background-position: top;
background-repeat: no-repeat;
margin-right: 4px;
}
#filter-menu .selected{
margin-top: 3px;
}
#filter-menu .home{
background-image: url('images/Home.png');
width: 78px;
}
#filter-menu .animals{
background-image: url('images/Animals.png');
width: 80px;
}
#filter-menu .ancient{
background-image: url('images/Ancient.png');
width: 80px;
}
#filter-menu .energy{
background-image: url('images/Energy.png');
width: 79px;
}
#filter-menu .env{
background-image: url('images/Environment.png');
width: 85px;
}
#filter-menu .travel{
background-image: url('images/Travel.png');
width: 79px;
}
- The first menu item should align with the left border.
- The last item should align with the right border.
- The distance between menu items should be automatically calculated.
pic: Help needed to modify the CSS rules, as currently the spacing is set manually and the last element doesn't align with the right border.