Design comparison
Solution retrospective
Hi!
- Is it ok in this case to use html elements in my css file instead of using classes?
- What with the mobile design? I didn't do nothing to get it, but when I resize the screen it looks good.
- I'm curious about the way I pushed footer to the bottom of the page.
Feel free to leave any feedback, thanks!
Community feedback
- @d-donnePosted over 1 year ago
To answer your question on using elements (Tag names) as CSS selectors, there's actually nothing wrong with it if you want elements of that type to have a general styling.
Class Names Have Higher Specificity Than Tag Names.
When you give that element a class name, the CSS styling using the class name will override the Tag name's styling affected by that CSS property.
For instance:
HTML
<p class="text-red" id="text-green">
CSS
p { background-color: black; color: white; } .text-red { background-color: yellow; color: red; } #text-green { color: green; }
If this paragraph is styled using the CSS, it'll actually show a green text with a yellow background, because IDs are more specific than class names, and class names than Tag names.
Here is an article I found: Importance of CSS Specificity
Marked as helpful0 - @MisaponcePosted over 1 year ago
Hi Damian your solution looks good, is pixel perfect 💯
In my opinion it is ok to use CSS element selector since it is one of the ways to achive that, you can also use ID and Classes selector either one or the other is fine.
I think using semantic HTML is what did the mobile design easier and to get the footer all the way to the bottom, try using margin-top: auto on the footer element
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