centering a horizontal rule

http://home.cogeco.ca/~trains/rrhist.htm
illustrates a problem with horizontal rule 
centering using auto margins

first two are not centering, last one does center
cuz it is nested in a div.....

but the rule works for a very simple case such as:

 
<?xml version="1.0"?>
<!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">
<head><title>Rule Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
hr {width:80%;text-align:center;margin:auto;
    margin-top:10px;margin-bottom:10px;border:1px solid black}
</style></head><body>
<hr />
</body></html>
-- 
-- 
John Russell, VE3LL@RAC.CA
http://home.cogeco.ca/~ve3ll
http://home.cogeco.ca/~trains
http://home.cogeco.ca/~cipher

Received on Sunday, 1 May 2005 16:36:38 UTC