如果我有除法height: 100px;
并且其中包含一个链接 - 我可以让链接填充除法的高度而不对值进行硬编码吗?
<div><a href="#">hello</a></div>
div {
height: 100px;
width: 100px;
background: red;
}
a {
background: green;
height: 100%; /* This does not work. Is it possible to set this height to 100% of container? */
}
小提琴:http: //jsfiddle.net/nPL65/