Forum Moderators: not2easy
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<style type="text/css">
ul {
margin:0 0 1em;
padding:0;
list-style:none;
border:5px solid #ccc;
float:left;
clear:left;
}
li { float:left; }
a {
float:left;
height:30px;
line-height:30px;
padding:2px 30px;
color:#000;
background:red;
}
li:nth-of-type(odd) a { background:blue }
a:hover {border:2px solid yellow}
.test1 a:hover{padding:0 28px}
.test2 a:hover{margin:-2px;position:relative}
</style>
</head>
<body>
<ul class="test1">
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
</ul>
<ul class="test2">
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
<li><a href="#">Link</a></li>
</ul>
</body>
</html>
As the article refers, there is also 6.1. ‘box-sizing’ property [w3.org] which was initially thought to be the solution for this, but is now at risk element and may not go forward.
Someone may want to see how MSIE behaves.
don't quote understand the reasoning for box-sizing being at risk when it has about 93% browser support (caniuse.com) and people (http://paulirish.com/2012/box-sizing-border-box-ftw/) are actively promoting it!Thanks for drawing attention to that Paul. The padding-box value is at risk (which isn't even relevant here). Sorry team, tired brain late at night.
Borders are centered on the grid lines between the cells.
... The left border width of the table is half of the first cell's collapsed left border, and the right border width of the table is half of the last cell's collapsed right border. ...
Are you certain about what you are seeing? On closer inspection I'm not so sure. Recalling outline is drawn around the edge of the border, so any variations are likely related to the interpretation of border-collapse (and for internal cells, maybe also stack order).