+ 3
Why the positioning for #top h1 works as expected only when i use display:table for #top?
7 Respostas
+ 2
just for debug use outline on #top and #top h1 eith different color and you will understand. Anyway, you have to translate #top h1 bt self-half width on the left then you hve to use on it transform:translateX(-50%);
+ 3
What's the expected?
+ 2
Thankyou very much.
+ 1
Its not very clear what you expect from your code...
+ 1
Top:50%
Left:50%
This doesn't places h1 at the center of header div unless i specify display:table for header div.
+ 1
Sameer Crestha Well,neither using table is centered but is seem centered because #top NOT fill width
0
Sameer Crestha You are welcome 👍🏻