Submitted about 2 years ago
Responsive preview component using CSS Grid and Flexbox
@MattPahuta
Design comparison
SolutionDesign
Solution retrospective
What are you most proud of, and what would you do differently next time?
This was a fun project and a great way to practice fundamental CSS Grid and flexbox as well as incorporate some basic JavaScript.
What challenges did you encounter, and how did you overcome them?At the time, I hadn't used the pseudo elements or absolute positioning very often, so getting the social-share component working properly took some trial and error.
What specific areas of your project would you like help with?I think my JavaScript code, minimal as it is, could probably be improved.
Community feedback
- @lij110397Posted 8 months ago
The code is so neat and I learnt a lot from the code. The thing I like about it:
- using descriptive content for the image
<img src="./images/drawers.jpg" alt="Green dresser, arranged stylishly against a white brick wall" class="article-img">
2.using place-items as short for align-items and justify-contents
min-height: 100vh; display: grid; place-items: center;
- All CSS parts are designed in the classes inside the CSS stylesheet. The javascript file only uses remove or add classes to control different styles, which makes all codes separate and neat.
What may the alternatives?
- using overflow:hidden to set the border-radius of the img using overflow to set the border-radius of img, then don't have to set each corner of the image. The overflow image part will be adjusted to the div container's border radius.
.article-card{ overflow: hidden; }
Marked as helpful0
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