
Solution retrospective
When I first tried to center the card by using
position: relative;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
only the bottom half of the card was visible while the top half was moved out of the screen. Why does this happen and how to overcome this??
Please log in to post a comment
Log in with GitHubCommunity feedback
- @Mennatallah-Hisham
Hi Capt-Coder,
Congratulations on completing your first challenge👏
You did great 👍
Here are some suggestions to improve your code:
Centered Card
- you can center the card both horizontally and vertically using flexbox
.parent{ display:flex; justify-content:center; align-items:center; }
Semantic HTML
- wrap your content in <main>,this element represents the dominant content of the <body>
- wrap your card in <article>
<main> <article> </article> <div> </div> </main>
Headings
- each page should have one h1 tag,h1 helps the web understand the content. also skipping h1 may confuse assistive technology users.
<h1>Improving your front-end skills by building projects</h1>
ALT
- images should have descriptive alt text, which is important for SEO and screen reader users,alt="QR code linking to Frontend Mentor challenges"
SEO
- you can add meta description for better SEO, it provides a brief summary of a web page
<meta name="description" content="..........."/>
here are some helpful articles:
Hope you find this helpful, Happy Coding
Marked as helpful
Join our Discord community
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