如果我与height: 100px;
进行了划分并且它包含内部链接 - 我可以使链接填充分部的高度而不对该值进行硬编码吗?将链接高度设置为其父项的100%
<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/
如果你想它填充整个div,改为'最小高度:100%' – 2013-03-10 17:59:18