EmmDub
asked on
Dotted border has extra pixel in Firefox
When using a dotted border on only one edge of a DIV, Firefox always puts a dot at both ends of the line, even if the pattern would normally call for a space. I'm guessing it does this to make sure the border is the right width, but I'd like it to give the pattern higher priority.
Paste the code below into an HTML file and you'll see what I mean. IE7 renders the pattern right, but the line is only 99 pixels long, which is fine by me. Opera alters the number of spaces between the dots in a best-effort approach to get the pattern and size right. Firefox, though, will have two dots at the end of the line.
Anybody know how to get Firefox to leave off that last dot, short of making sure all my border lengths are an odd number of pixels (which I can't guarantee with dynamic content).
Paste the code below into an HTML file and you'll see what I mean. IE7 renders the pattern right, but the line is only 99 pixels long, which is fine by me. Opera alters the number of spaces between the dots in a best-effort approach to get the pattern and size right. Firefox, though, will have two dots at the end of the line.
Anybody know how to get Firefox to leave off that last dot, short of making sure all my border lengths are an odd number of pixels (which I can't guarantee with dynamic content).
<html>
<head>
<style>
DIV.bottom {
border-bottom: 1px dotted black;
width: 100px;
}
DIV.right {
border-right: 1px dotted black;
width: 10px;
height: 100px;
}
</style>
</head>
<body>
<div class="bottom"></div>
<div class="right"></div>
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You could give the div a background color and the image. Maybe something like this...
div
{
background: blue url(dottedline.gif) repeat-x left bottom;
border: none;
padding-bottom: 25px;
margin-bottom: 25px;
}
ASKER
Thanks for the info. I'll accept your first comment because, in this case, "you can't" seems to be the right answer.
ASKER