Verticly align a hr

liunx

Guest
Hi,

I am trying to get the hr to be exactly in the middle of the div verticly for all broswers.

IE displays hr completely differently to the other browsers.

Using verticle-align:middle only work in IE although it is not exactly the middle.

This is the code i have


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
#straplinehr {
height: 75px;
background-color:#000000;
}

.straplinehr {
width: 300px;
text-align: center;
height: 2px;
color: #FFCC33;
background-color: #FFCC33;
border: 0;
}
</style>
</head>

<body>
<div id="straplinehr">
<hr class="straplinehr">
</div>
</body>
</html>


Many Thanks

k0r54from W3C hr (<!-- m --><a class="postlink" href="http://www.w3.org/TR/REC-html40/present/graphics.html#h-15.3">http://www.w3.org/TR/REC-html40/present ... tml#h-15.3</a><!-- m -->)
The amount of vertical space inserted between a rule and the content that surrounds it depends on the user agent.

Use an empty div with style="width:300px;border-bottom: 2px solid #fc3;"ok that works but i cant seam to figure out how you align it verticly to the middle and horizontaly to the centre.

Thanks
k0r54Dead center (<!-- m --><a class="postlink" href="http://www.wpdfd.com/editorial/thebox/deadcentre4.html">http://www.wpdfd.com/editorial/thebox/deadcentre4.html</a><!-- m -->)
 
Back
Top