Last active
June 23, 2025 00:47
-
-
Save pethaniakshay/34b57707d9d6d4ab35b03bb02b7dd968 to your computer and use it in GitHub Desktop.
HTML/CSS code to vertically+horizontally centre the text in div tag. https://www.codepuran.com/web-designing/vertically-horizontally-align-text-div/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="de"> | |
<head> | |
<title>Verticlly Center Text</title> | |
<style> | |
html, body { | |
height: 100%; | |
margin: 0; | |
padding: 0; | |
width: 100%; | |
} | |
body { | |
display: table; | |
} | |
.centered-text { | |
text-align: center; | |
display: table-cell; | |
vertical-align: middle; | |
} | |
</style> | |
</head> | |
<body style="background:#3cedd5"> | |
<div class="centered-text"> | |
<h1>Yes It's My landing Page</h1> | |
<h2>Under Construction, Coming Soon !!!</h2> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment