HTML CSS examples for CSS Layout:Text
Align text inside the parent div
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> #slide-container a { display:table; width:100px; height:151px; margin:0 auto; } .CV {<!-- www .j a va 2s. c o m--> background-color:Chartreuse; display:table-cell; vertical-align:middle; text-align:center } #slide-container { margin:0 auto; padding:13px; border:2px solid yellow; } </style> </head> <body> <div id="slide-container"> <a href="http://www.stackoverflow.com"> <div class="CV"> This my entire a test </div> </a> </div> </body> </html>