Oleg
Oleg

Reputation: 23

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>

Upvotes: 2

Views: 4140

Answers (1)

ajinkya narkar
ajinkya narkar

Reputation: 382

Use height:inherit for p tag element.

Upvotes: 2

Related Questions