Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Title of the document</title> <style> #parent { display: table; width: 100%; height: 200px; border: 3px dashed #1c87c9; text-align: center; } #child { display: table-cell; vertical-align: middle; } </style> </head> <body> <div id="parent"> <div id="child">I am vertically centered</div> </div> </body> </html>