+ 11
I need help in this code...
Link to the code: https://code.sololearn.com/W8HWsTpE6PqS I want to align the heading vertically center but it's not happening(I used flexbox for the purpose). Can anyone tell me the error in it?
5 Respostas
+ 15
Error solved. I just removed the div tag as it was kinda feeling like some extra stuff. Then I specified the height of section tag that is-height="100%". Then in CSS, in .home h1, {vertical-align:middle;}.
https://code.sololearn.com/W9t8B5Aon8XB/?ref=app
+ 11
Thanks guys
+ 6
@chirag
add below CSS in addition to what you have
.name h1{
margin:auto
}
.name{
height:100%;
width:100%;
}
It should solve your problem.
+ 2
Check if the results of what i commented are good for you.
+ 1
The h1 is already vertically aligned s:
Try to increase the height of the div in order to see the difference.
You might want to add something like this to your CSS code:
.home, .name{
height:100%;
}