Design comparison
Solution retrospective
The next time I would try to display the content of my page better.
What challenges did you encounter, and how did you overcome them?The most difficult part was displaying the various element with the correct width and height. Also it is not so easy for a beginner who doesn't know any css framework to center the various elements.
What specific areas of your project would you like help with?I would like some feedback on how to correctly display elements. At the beginning I was trying to set the width and height of the image using css but it didn't work. So i had set the width and height of the image inside the container with attribute inside the img element. It would be very helpful if someone explain me how can I display elements without resorting to trial and error using various px measurement for the width and height of element. Next I don't know why if I use more padding for the img element the border on top become straight and the border-radius property doesn't seem to work. I should say that the practice is really different from the theory. Any help will be greatly appreciated. Thank you very much
Community feedback
- @saularangurenPosted 7 months ago
Greetings, your solution is really impressive, however, we can improve your solution, let's start by removing the following lines of code inside the index.html file, which are unnecessary:
<footer> <span> Challenge by <a href="https://www.frontendmentor.io?ref=challenge" target="_blank">Frontend Mentor</a>. Coded by <a href="#" target="_blank">Arcloan</a>. </span> </footer> the last: </html>
Let's continue, we are going to replace this
<div id="container"></div>
with a<main id="container"></main>
, this way you are respecting the semantic html and finally I recommend removing these attributes from the img tag,width="310" height="290"
, these measurements must be written in the CSS style sheet:img { width: 310px; height: 290px; }
add these lines to the body, don't use
height: 98vh;
delete this linemargin:200px auto 200px auto;
from#container {}
in style.css:body { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
happy coding š
Marked as helpful1@ArcloanPosted 7 months ago@saularanguren thank you very much. Tonight i will try your suggestion
1 - @danielmrz-devPosted 7 months ago
Hello there!
Congrats on completing the challenge! ā
Your project is looking fantastic!
I'd like to suggest a way to make it even better:
- Using
margin
isn't always the most effective method for centering an element.
Here's a highly efficient approach to position an element at the center of the page both vertically and horizontally:
š Apply this CSS to the body (avoid using
position
ormargins
in order to work correctly):body { min-height: 100vh; display: flex; justify-content: center; align-items: center; }
I hope you find this helpful!
Keep up the excellent work!
Marked as helpful0 - Using
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