Run ยป
<!DOCTYPE html> <html> <head> <title>Title of the document</title> <style> body{ margin: 10px; font-size: 15px; } .container-6{ width: 750px; height: 400px; background-color: cadetblue; display: table-cell; vertical-align: middle; } .container-6 .center{ width: 300px; color: white; height: 150px; background-color: red; margin: auto; } </style> </head> <body> <h2>6. Center div tag with display table and vertical align</h2> <div class="container-6"> <div class="center"> Center box with display table and vertical align </div> </div> </body> </html>