Design comparison
Solution retrospective
Having trouble getting footer p to respect the reduced font-size setting @ 475px
Used flexbox mostly..
Community feedback
- @dusan-bPosted about 2 years ago
Hi Nicholas,
I have just looked at your code and noticed that three CSS rules address the
<p>
element inside<footer>
:.attribution { /* SPECIFICITY: 10 */ font-size: 11px; } footer p { /* SPECIFICITY: 2 */ font-size: 4px; } @media screen and (max-width: 475px) footer p { /* SPECIFICITY: 2 */ font-size: 4px; }
The class selector
.attribution
will always win because of its higher specificity. You could solve this problem by replacingfooter p
with.attribution
within the media query.You can learn more about specificity in CSS on Google Developer's web.dev website.
Another tip: Avoid defining media queries with
max-width
only, as they overlap each other, which again can lead to problems with specificity.I hope I could help. Keep going, and happy coding. :)
Marked as helpful1
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