
January 24th, 2013, 12:19 AM
|
 |
Code Monkey V. 0.9
|
|
Join Date: Mar 2005
Location: A Land Down Under
|
|
A good way to do this so it's a bit more friendly then risking if things are one pixel out is to add an inner div tag, then style the outer tag for the full width, and apply any borders or spacing to the inner div. This keeps each area at the correct width, nothing overflows and you're able to set up any margins/padding/borders that you want without risking the layout.
As an example...
Code:
<div class="outer_div"><div class="inner">Content goes in here</div></div>
Code:
.outer_div {
width: 25%; // Assuming 4 equal spaced items
float: left;
}
.outer_div .inner {
margin: 0 2px;
border: 1px solid #000000;
padding: 5px;
}
|