Tell us what’s happening:
I am unable to center the title, can anyone help me with that ?
Your code so far
Your browser information:
User Agent is:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36.
Challenge: Build a Tribute Page
Link to the challenge:
I added a background color to help see what is going on…
position: absolute doing, and does it need to be like this? What are
top/left doing ? Where is the origin
(0,0) of this element?
<div class="hero-text row">
<p>Forest Man of India</p>
For the above code i tried to do it without
position property it didn’t work. I thought let take this element out of flow then
right will work. But unfortunately that also didn’t work.
No it does not need to be like this as i said, i am a beginner i don;t have that much experience. With out top left how can i center my
text within it ? Please help
Remove the positioning and try margin: auto
It took the
div to top
Hey mr. pjonp i found the solution in google here : https://css-tricks.com/centering-css-complete-guide/
transform: translate(-50%, -50%) solves the issue or by using
display:flexbox and aligning it on both axis central.
But i really don’t understand how it work. Could you help me with that ??