I am trying to vertically focus some content using CSS. For my life, I canβt understand the reason. Can someone tell me why the word βtestβ in the following HTML is always aligned in height no matter what I do?
<html> <head> <title>test</title> </head> <body> <table border='0' cellpadding='0' cellspacing='0'> <tr><td style='height:200px; width:300px; background-color:silver;'> <div style='height:100%; width:100%; background-color:gray; text-align:center;'> <div style='vertical-align:middle;'>test</div> </div> </td></tr> </table> </body> </html>
Many thanks for your help!
html css
user208662
source share