W3C home > Mailing lists > Public > www-amaya@w3.org > April to June 2005

centering a horizontal rule

From: <ve3ll@rac.ca>
Date: Sun, 01 May 2005 12:36:34 -0400
To: www-amaya@w3.org
Message-ID: <4274CD52.4222.E91A3D@localhost>

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

This archive was generated by hypermail 2.3.1 : Tuesday, 1 April 2014 11:01:43 UTC