Design comparison
Solution retrospective
Is there elements/styles I could've used for best practice purposes?
Community feedback
- @vanzasetiaPosted over 1 year ago
Hi!
I don't recommend using
id
selectors for styling. There are two reasons for not using ID’s to style content:- They mess up specificity because they are too high (the most important reason).
- They are unique identifiers. So, they are not reusable on the same page.
Learn more — What the ID attribute is REALLY for
Never use
px
unit for font sizes. Userem
orem
instead. Relative units such asrem
andem
can adapt when the users change the browser's font size setting. Learn more — Why you should never use px to set font-size in CSSI hope this helps.
Marked as helpful1@vanzasetiaPosted over 1 year ago@ifcoder1
About your question, I recommend using
<body>
element as the wrapper of the card,<main>
element for the card.
Then, remove the
<section class="content-text">
. I recommend setting the text alignment on the card element.This way, you end up with simple HTML markup without an extra
<div>
and<section>
.Marked as helpful1@ifcoder1Posted over 1 year ago@vanzasetia Thank you. This was extremely helpful. Going to use this advice for my future projects.
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