View Single Post
Old May 8th, 2007, 9:48 AM   #2
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
You're overspecifying when you specify left and right margins and the width. What if that doesn't add up to the width available? Pick which one you want to control, and control it. Let the other adapt.

To center the two divs, put them in an enclosing div. Style that div for margin-left: auto and margin-right: auto. That takes care of compliant browsers. Style it text-align: center to take care of IE. Since you don't want the text centered, then in the two enclosed divs, style text-align: left.

You're much better off using padding than margin, simply because of browser differences.

You can save yourself more typing in situations like this:
	border-color: black;
	border-style: solid;
	border-left-width: 1px;
	border-right-width: 1px;
	border-bottom-width: 1px;
	border-top-width: 1px;
That can be done with
        border: 1px solid #000000;

See here for a look at your page after a quick dinking.

You do need to run a spell check and a grammar check. It's worth the investment in time.

EDIT: Move your doc type above the <html> tag. I also recommend using 4.01 strict to avoid throwing IE into quirks mode.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers

Last edited by DaWei; May 8th, 2007 at 10:03 AM.
DaWei is offline   Reply With Quote