Design comparison
Solution retrospective
Focus frame on the small link images is bigger than the image itself, how to fix it? Thank you for any suggestions.
Community feedback
- @amalkarimPosted almost 2 years ago
Hi Algirdas π
The problem is caused by the image. By default,
img
element hasdisplay: inline;
and it sits on baseline where letters like a, b, c, and d sit on. The space below is for the descenders on letters like g, j, or p. Take a look at this stackoverflow question.To solve the problem, simply add
display: block;
to.top-article__img-box a img
selector, so it looks like this:.top-article__img-box a img { max-width: 9rem; height: auto; display: block; }
Hope this helps. Happy coding!
Marked as helpful1 - @BiljanaKotevPosted almost 2 years ago
your solution is great, can i ask you where you learned to code? Can you send me some resource links ... thanks.
0@AlgirdasUPosted almost 2 years ago@BiljanaKotev Hi Bilijana and thank you for the compliment :) I bought several courses from the Udemy https://www.udemy.com/ first was this course for beginers: https://www.udemy.com/course/design-and-develop-a-killer-website-with-html5-and-css3/?src=sac&kw=Build+Responsive+Real-World+Websites+with+HTML+and+CSS whene I learned I bought advanced HTML, CSS course https://www.udemy.com/course/advanced-css-and-sass/?src=sac&kw=Advanced+CSS+and+Sass%3A+Flexbox%2C+Grid%2C+Animations+and+More%21. I hope it helps you ;)
0
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