I used html structure and css , and use of divs and classes selectors

Solution retrospective
1.Are there any best practices in terms of CSS styling or HTML structure that I could improve upon? 2.Is the image optimization done effectively for fast loading times and optimal performance? 3.Are there any areas of my code that could be refactored or optimized for better efficiency?
Do you have any suggestions or feedback on the choice of fonts, colors, and overall design aesthetics of the website? Are there any other best practices or recommendations that I should be aware of to improve the quality and performance of my front-end project?
Please log in to post a comment
Log in with GitHubCommunity feedback
- @ecemgo
Some recommendations regarding your code that could be of interest to you.
- I think Flexbox is better than Grid in centering both horizontally and vertically. I recommend this method, it's up to you whether to apply it or not :)
- If you want to make the card centered, you'd better add flexbox and
min-height: 100vh
to thebody
- For the color of the screen, you can use the recommended color in the body
body { /* background-color: rgba(214, 216, 218, 0.445); */ /* text-size-adjust: 100%; */ /* display: grid; */ /* place-items: center; */ /* height: 100vh; */ font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif; /* text-size-adjust: none; */ background-color: hsl(212, 45%, 89%); display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 100vh; }
- In addition to that above, in order to make the card responsive and the image positioned completely on the card, you'd better add
width: 100%
anddisplay: block
for the img in this way:
img { /* width: 240px; */ width: 100%; display: block; border-radius: 10px; }
- You don't need to use
.code-div
and you can remove it
/* .code-div { margin-bottom: 10px; margin-top: 10px; } */
Hope I am helpful. :)
Marked as helpful - @Faizan98x
Use HTML semantic tags as they will help in better SEO. Replace the <div> with <main> or <section>. Follow this link to get more about semantic tags : https://www.w3schools.com/html/html5_semantic_elements.asp
And also use -moz-text-size-adjust: none; -webkit-text-size-adjust: none; for cross-browser compatibility
Marked as helpful - @EmmanuelUrias
It looks great, but some things I'd like to point out is that putting some more padding on the bottom would be more aesthetically pleasing, and making the card wider would have made the text fit better within it. Looked at your code base and I would recommend having a consistent format when it comes to tabbing and line spaces to make it more readable and overall look cleaner. Another important thing is a really consistent naming style, you went from camel case with mainDiv to kebab case for code-div. Other than that great job!
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