Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Whitespace showing when using ems as a border width

Status
Not open for further replies.
Dec 8, 2003
17,047
GB
I'm using the latest Firefox browser (v1.0.1), and am seeing strange behaviour when using ems for border widths.

The problem does not show up in IE or Opera, but does in NN 7 (due to similarities in the rendering engine, no doubt).

Here is a simple test harness. Set your font size to "Normal" (Ctrl-Zero) and run:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Strict//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml"[/URL] lang="en" xml:lang="en">
<head>
	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
	<style type="text/css">
		div {
			border: 0.2em solid #000000;
			padding: 10px;
			margin: 0px;
		}
	</style>
</head>
<body>
	<div>123</div><div>456</div><div>789</div>
</body>
</html>

As you can see, the code has no whitespace between the DIVs, but a clear break is visible between the last two DIVs.

The presence of this whitespace comes and goes, depending on the text zoom.

Does anyone have any idea how to stop this from happening, but while still keeping relative-sized borders?

Thanks!

Dan


The answers you get are only as good as the information you give!
 
Very weird problem. Appears to be present only with 0.2em. I must say I am stumped by this. Needless to say Mozilla renders the same as FF. Fixing size to 0.21em helps though.
 
Thanks Vragabond,

Unfortunately, while increasing the border width to 0.21em stops the problem showing at 100% zoom, it still suffers from the problem at other zooms, just like the 0.2em value did.

I've filed a bug report with Mozilla on this one:


as it happens in NN 7, and the latest nightly build of Mozilla, too (so chances are it's a Gecko rendering bug).

Thanks anyway!
Dan



The answers you get are only as good as the information you give!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top