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.