0
How can I position a word in the middle of a page?
I want to position the word "CSS" in the middle of the page. How can I do it?(irrespective of size of view-port)
5 Answers
+ 1
display:flex;
align-items:center;
justify-content:center;
+ 1
Abhishek Kudlur yup I know ,if you are looking to middle the text Logomonic Learning solution works fine ,but you need to provide a height to whatever container you will apply those properties to,
Or you could also do something like this for centering text
body{
height:300px;
}
div{
margin:auto
}
body here is representing parent container whose child is div element
0
text-align: center
0
Abhay this will make text appear in the middle of the line.
What I want is it should be in the middle of the page.
0
Logomonic Learning thanks..
but that doesn't make the text appear in center of the page. It just appears in middle on the top of the page