Zaloguj | Zarejestruj | FAQ

Vertical centering

+ Odpowiedz

Posty: 2 Strona 1 z 1

Vertical centering

przez lombardyjim » Cz paź 05, 2017 4:11 pm

I have a title in a header. I can horizontally center, but can't get it off the top line in the header. Ideas? I need code, please, as an example. Thanks!
Avatar użytkownika


  • Posty: 8
  • Dołączył(a): Wt cze 06, 2017 2:54 pm

Re: Vertical centering

przez pavithra.ramesh » Wt lut 13, 2018 11:19 am

You can use many methods.
Here are a few examples:

Marging Top


If you want to position the title vertically in the center, you can choose the following code.
.header {
position: relative;
.h1 {
position: absolute;
top: 50%;
transform: translateY(-50%);

Check this code. I hope this should work. Please let me know if it doesn't work. I will create a pen in the codepen and share you the link.


Pavithra Ramesh
Avatar użytkownika


  • Posty: 9
  • Dołączył(a): Wt lut 06, 2018 10:50 am

+ Odpowiedz

Strona 1 z 1