简体   繁体   中英

CSS height 100% not working on TD

I don't understand why height 100% for css link is not inheriting height value pointed at td or table? But width value with 100% inherits value of the td or table.

 .mybutton a { display: block; width: 100%; height: 100%; background: #666666; color: #FFFFFF } .mybutton a:hover { display: block; width: 100%; height: 100%; background: #666666; color: #FFFFFF } 
 <table border="0" cellpadding="0" cellspacing="0" width="210" height="50"> <tr> <td width="210" height="50" class="mybutton"><p align="center"><a href="#">BUTTON</a></p></td> </tr> </table> 

p标签元素使用height:inherit

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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