View Full Version : <hr> and <table> not centering in Netscape

02-09-2004, 04:45 PM
I noticed that in my external CSS stylesheet, even if I attempted to use "vertical-align: center" to center <hr> on an html page, it still showed as left-aligned instead. For now, my workaround was this and it worked in IE, but not in Netscape:

<p align="center"><hr width="50%" /></p>

Anyone know of a way to center <hr> on a page, when viewed with IE, Netscape, or Opera? "vertical-align: center" didn't work, and neither did "text-align: center" (which I tried out of sheer desperation).

Now that I think about it, I noticed that tables weren't centering in Netscape either, even when I had <table align="center" in the html. I've used the same workaround of enclosing the table in a <p align="center"> and it does work for both IE and Netscape. It's just extra coding I'd like to cut down on...

Anyone know a way to alleviate this prob as well?

Roy Sinclair
02-09-2004, 05:22 PM
<hr style="width: 50%;" />

Worked just fine in both IE and Moz. Therefore you must be asking about Netscum 4.x for some reason, in that case the answer is simple. It's OBSOLETE, don't bother trying to make everything work perfect for a browser who's only proper place is in the garbage heap, you're just wasting time that would be better spent on other projects. For those ancient and obsolete browsers the only need is to make sure the CONTENT of the web page is accessible and the NAVIGATION is functional, perfection of placement while keeping good coding practices is usually not possible and the percentage of people still using that antique is low enough to be virtually negliable.

02-09-2004, 08:16 PM
NS4.7 doesn't support css so test with NS6+. I always try NS7 because it's tighter than IE and the only extra browser I have.

On a side note, I have knoppix linux OS which I think comes with another browser or 2...but my video card is too old to run the OS

Bottom line...test in NS6+ IE5+

02-09-2004, 10:04 PM
So you're both saying that <hr> should be centered automatically? I'm previewing it right now under Netscape 7, and the stupid thing's aligned to the left. BRB, I'm going to see if maybe some other CSS before it is overruling the HR portions...

If after that, it still is left-aligned on my Netscape 7 screen, I'll post the URL... Thanks...

Roy Sinclair
02-09-2004, 10:14 PM
In a simple page you'll find it's centered:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<style type="text/css">
hr { width: 50%; }
<hr />

02-09-2004, 10:29 PM
I am going to kill myself if you guys see this page with centered HRs and I don't, even when I'm viewing it with Netscape 7. Here's a link:


Try the link now... Forgot the silly ~ in the URL...

Roy Sinclair
02-09-2004, 11:21 PM
That link doesn't seem to work.