@traez's Four card feature section using HTML and CSS
Design comparison
Solution retrospective
What I learned:
- Satisfactorily completed this in under 24 hours. Full speed ahead.
- Continued romance with CSS Grids, so far so good.
- Tried different selector combinations (attribute selectors) here.
- Had actual need for box shadow here.
Continued development/Short falls:
- As usual additional middle media query would be nice. But will be a learning priority much later.
- As usual also could put more effort into item sizing to make clone exact copy.
Community feedback
- @SurajHadagePosted over 2 years ago
- I would recommend you to not upload unnecessary files and folders to save server space.
- Use headings from h1 to h6 chronological order. This is more meaningful and well structured web layout.
- Always use
<h1>
tag to your every webpage. - You can structure your
<header>
like :
<h1></h1> <h2></h2> <p></p>
- This is more short.
You can use
<article>
or<section>
tag for every card. And structure like:
<h3> <p> <figure>
I hope you find this helpful.
Marked as helpful0 - @correlucasPosted over 2 years ago
๐พHello Trae, congratulations for your solution!
To change your solution to the mobile version, I mean all the cards in the same column, all you need to do is change the
grid-template-column: 1fr
or instead of usinggrid
you can usedisplay: flex;
with a media query.See the code below:
@media (min-width: 37em) main { display: flex; /* grid-template-columns: 1fr; */ /* column-gap: 1rem; */ /* width: 62rem; */ /* height: auto; */ flex-direction: column; }
If you do that all cards will stay in the same column, so all you need to do is adjusts some padding to center everything.
Hope it helps and happy coding!
Marked as helpful0@traezPosted over 2 years ago@correlucas Love the hack. Guess it worked cos minimum change between desktop and mobile versions. I build mobile design first, hence the voluminous code. But well noted for next time. Thanks.
1
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