开发者

set width for <a element in <td to 100%

is there any way to set the link element <a to 100% width开发者_运维知识库 inside a <td ???

thank you


A link <a> is inline element, you can't apply a width to it unless you make it block-level element:

#tableID td a{
   display:inline-block;
   width:100%;
}

The above selector will make all links inside td inside table with id #tableID block so that width is applicable.

Check out Inline and Block elements for more info


Give the <a> element display: block; and it will gain the full width of its parent.

Working demo: http://jsfiddle.net/sUT5e/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜