Design comparison
SolutionDesign
Solution retrospective
What would be the easiest shortest optimized way to execute this file?
Community feedback
- @yigithancolakPosted over 1 year ago
Hi i liked your UI some much. It has a little bit different positioning than the original one but yours look better i think. For the code, i recommend you to look at semantic HTML codes. You should wrap the app inside <main> tag for making it semantic instead of using too many <div> tags it will make your code look more professional.
Marked as helpful0 - @ecemgoPosted over 1 year ago
Some recommendations regarding your code that could be of interest to you.
HTML
- In order to center the card correctly, you'd better remove
<div class="container-fluid">
from html.
CSS
- Then, you'd better add flexbox and
min-height: 100vh
to thebody
to center the card vertically and horizontally
body { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 100vh; }
- If you use flexbox in the
body
, you don't need to usemargin
in the.main-div
to center the card - If you use
max-width
instead ofwidth
, the card will be responsive - You'd better give
padding
to give a gap between the content and the border of the card
.main-div { /* width: 275px; */ max-width: 275px; /* margin: 9% auto; */ padding: 10px; }
- 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: 250px; */ /* height: 250px; */ border-radius: 5%; /* margin-bottom: 5%; */ width: 100%; display: block; }
- You don't need to use
margin
andwidth
forp
and you can remove them
p { /* width: 95%; */ /* margin: 0 auto; */ }
- Finally, you'd better remove
.section-img
to avoid the repetition if you want
/* .section-img { padding-top: 12px; } */
Hope I am helpful. :)
0 - In order to center the card correctly, you'd better remove
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