Page is a not externally linkable
- Code, Content, and Presentation
-- CSS
---- Style last div


enigma1 - 2:44 pm on Oct 4, 2010 (gmt 0)


Use the first sample code by birdbrain with the divs but instead of specifying just one div for the margin specifics setup a class so the right-side divs have no right margin.

here it is


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en">
<head>
<title>test page</title>
<style type="text/css">
#container {
width:1002px;
padding:10px;
border:1px solid #000;
margin:auto;
overflow:hidden;
}
#container div {
float:left;
width:241px;
padding:5px 0;
border:1px solid #600;
margin-right:10px;
background-color:#fee;
text-align:center;
}
#container .rightside {
margin-right:0;
}
</style>
</head>
<body>
<div id="container">
<div>box one</div>
<div>box two</div>
<div>box three</div>
<div class="rightside">box four</div>
<div>box five</div>
<div>box six</div>
<div>box seven</div>
<div class="rightside">box eight</div>
</div>

</body>
</html>


The rightside class is set with a 0 margin for the right side.


Thread source:: http://www.webmasterworld.com/css/4172531.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com