DIVs vs. Tables
Down for Maintenance
Custom Error Pages
Escaping query strings
Google App testing
Avoid AS Statics
DIV block layouts
The standard layout for div elements is to show them one under the other.
And the code for that is similar to:
box number one
box number two
Unfortunately this is rather limited since it insists that the left side of each block touches the left of edge of its container. However that doesn't mean that you can do alot using padding and margin settings.:
<div style="border: 6px solid black; width: 400px; height: 200px">
There is free space to the right of green yet the blue
box is forced down to the left margin.
<div style="border: 2px solid green; width: 50%; height: 50px">
<div style="border: 2px solid blue; width: 52px; height: 50px">
But you can make use margins to adjust things, like for this red box <div style="margin-top: -50px; margin-left: 70px; border: 2px solid red; width: 52px; height: 50px">
Margins and widths (also padding and height) are not the best ways to
try positioning your page elements.
Fortunately there are at least 2 ways around these shortcomings.
Did you find this article userful for your website?
If so, why not provide a link to it? Just copy the following to your web page: