简体   繁体   English

展开元素以填充li

[英]Expand a element to fill li

I'm trying to expand the a elements of this jsfiddle to fill the li element, but display:block does not work as I'm using a table to space them. 我正在尝试扩展此jsfiddle的a元素以填充li元素,但是display:block无法正常工作,因为我正在使用表格来隔开它们。

How can this be done in order for my colored corners to work? 如何才能使我的彩色角工作? As I've got a background set on both a and the li elements to give the illusion of colored corners. 因为我在ali元素上都设置了背景,以给出彩色角的错觉。

http://jsfiddle.net/286bu/ http://jsfiddle.net/286bu/

Add a height parameter to your a tag so it fills the entire height of the li : a标签中添加height参数,以使其填充li的整个高度:

.menu a {
    font-size: 11px;
    color: #FFFFFF;
    display: block;
    background: #000;
    padding: 5px 20px;
    -webkit-border-radius: 0px 0px 10px 0px;
    border-radius: 0px 0px 10px 0px;
    text-transform: uppercase;
    height:100%;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM