@rriadhh
Posted
try this .main-element { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) }
Marked as helpful
I have completed the challenge however i could not get the item to centre as per guide image, so any feedback on what has gone wrong in this regard is greatly appreciated
@Nadine-Green
Posted
HEY MARTA
About your problem with centering the .flex-container, what you can do is give the body a display of a grid and then use the code place-items: center;
.
If you find this helpful, don't hesitate to upvote my feedback
HAPPY CODING!
@icaroMendes777
Posted
For your first challenge it is ok,
Centering a div is one of the jokes about starting html and css, the two main ways nowadays are flexbox and grid. there are many articles about it online, like this one:
https://www.freecodecamp.org/news/how-to-center-anything-with-css-align-a-div-text-and-more/
also have a look for typography, the font used, there are espacifications about which one to use in the MD files that come with the project. But the main thing is to notice that the original is a sans-serif font (has no pointy edges on the characters).
these are the basics, hope you have a lot of fun coding!
@elsgoossens
Posted
This looks ok. I am new to this too.
I hope to add just a little thing at least: One thing I think is good practice is to write for font-family 'Outfit', sans-serif; instead of 'Outfit'; so if Outfit would not work for any reason there is a fallback. Besides that, keep going, doing great !
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord