Need help with a css site

icehole

[H]ard|Gawd
Joined
Jun 9, 2004
Messages
1,506
I am building a site for a friend. The template I am using have 4 "boxes" and I need 5. I want the 5th centered below the other 4 but no amount of adding <align="center"> will get it centered. Any help would be appreciated.
 

Attachments

  • Screenshot (43).png
    Screenshot (43).png
    550.4 KB · Views: 0
  • Screenshot (44).png
    Screenshot (44).png
    585.2 KB · Views: 0

modi123

Supreme [H]ardness
Joined
Sep 6, 2006
Messages
6,687
Setting a size, and margin-left and margin-right to auto should center it to the larger div.

Ex:
HTML:
<div style="width:200px;">
    <div style="float: left; display: block; position: relative;">
        <div style="width: 100px; height: 100px; float: left; background-color: red;">asdf</div>
        <div style="width: 100px; height: 100px; float: left; background-color: green;">asdf</div>
        <span style="clear:both;"></span>
    </div>


    <div style="clear: both; float: left; display: block; position: relative;">
        <div style="width: 100px; height: 100px; float: left; background-color: blue;">asdf</div>
        <div style="width: 100px; height: 100px; float: left; background-color: purple;">asdf</div>
    </div>
    <div style="clear: both; display: block; position: relative; width: 100px; height: 100px; background-color:yellow;margin-left:auto; margin-right:auto;"></div>
</div>
 
Top