@TedJenkler
Posted
Hi @Ihdir,
Nice project! Here are a few suggestions:
Another fun way to center a <div> is by using position: relative on the parent and position: absolute on the content, with top: 50%, left: 50%, and transform: translate(-50%, -50%). For a challenge, you could also center it with Grid, but Flexbox is definitely the easiest method in this case.
I’d suggest improving your semantic structure a bit. For example, you’ve nested your component in many <div>s, when one main container for the card, combined with Flexbox on the body, would be sufficient. Using fewer <div>s makes your code easier to read and helps search engines better understand your page.
I noticed you’re using both <h1> and <h2>. While this isn’t necessarily wrong, the <h1> tag should be reserved for the page title and should only appear once. For card components or other sections, using <h2> for headings and <p> for paragraphs would be more appropriate.
Keep up the great work!
Best, Teodor
Marked as helpful
@Ihdir
Posted
Hi @TedJenkler ,
Thank you so much for the feedback and suggestions!
I've seen people centering elements using top: 50%, left: 50%, and transform: translate(-50%, -50%), but I haven’t tried it out yet. I'll definitely give it a go and see how it works for this project. I'll also take your other advice into consideration, like improving the semantic structure and using proper heading tags.
I really appreciate your input, and I'll work on applying these changes to improve my code!
Best regards, Ihdir