Design comparison
Solution retrospective
My first solution left me quite unsatisfied so I took the tips left in the comments and used them to improve the solution. Any other suggestions are welcome.
Mi primera solución me dejo bastante insatisfecho asique tome los consejos que dejaron en los comentarios y los use para mejorar la solución. Cualquier otra sugerencia es bienvenida.
Community feedback
- @pperdanaPosted over 1 year ago
Hello there 👋. Congratulations on successfully completing the challenge! 🎉
- I have some additional recommendations for your code that I think you'll find interesting and valuable.
📌 Add
<main>
tag as semantic HTML in code-
The
<main>
tag is a semantic HTML element that is used to define the main content of a web page. -
The
<main>
tag should be used to wrap the primary content of a web page, such as the main article, section, or body of text.
for example code:
<main> <div class='container'> <h1>Article Title</h1> <p>Article content goes here...</p> ....................... </div> </main>
In the example above, the
<main>
tag is used to wrap the<div>
tag, which contains the primary content of the web page. This tells both human readers and search engines that the content inside the<main>
tag is the most important and relevant content on the page.I hope you found this helpful!
Happy coding🤖
1 - @ecemgoPosted over 1 year ago
Some recommendations regarding your code that could be of interest to you.
- In order to center the card correctly, you'd better add
min-height: 100vh
to thebody
- If you want, you can use the recommended color for the background:
body { min-height: 100vh; background-color: hsl(212, 45%, 89%); }
- After adding them, you need to remove
margin
and you don't needoverflow
andheight
: - You also need to fix the width:
.attribution { /* margin: 2.5rem; */ /* background-color: #eee; */ background: white; /* width: 25%; */ max-width: 320px; /* max-width makes the card responsive */ /* height: 20%; */ /* overflow: hidden; */ }
- Finally, you'd better fix the
img
. For this, you can addwidth: 100%;
,height: 100%;
anddisplay: block;
.attribution img { /* width: 200px; */ width: 100%; /* height: 200px; */ height: 100%; display: block; }
Hope I am helpful. :)
1@Morfeo1997Posted over 1 year ago@ecemgo Thank you, I will try to implement them.
1 - In order to center the card correctly, you'd better add
Please log in to post a comment
Log in with GitHubJoin 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