Design comparison
Solution retrospective
This is my first challenge here based on HTML + CSS only. I would really appreciate your feedback on this code and possible improvements. Thanks in advance.
Community feedback
- @danielmrz-devPosted 9 months ago
Hello @chriszych!
Your solution looks great!
I have a couple of suggestions (about semantic HTML) for improvement:
š First: Use
<main>
to wrap the main content instead of<div>
.Think of
<div>
and<span>
in HTML like plain boxes or placeholders. They're handy for holding content, but they don't tell us anything about what's inside or what it's meant for on the webpage.š Second: Use
<h1>
for the main title instead of<h2>
.Unlike what most people think, it's not just about the size and weight of the text.
- The
<h1>
to<h6>
tags are used to define HTML headings. <h1>
defines the most important heading.<h6>
defines the least important heading.- Only use one
<h1>
per page - this should represent the main heading/title for the whole page. And don't skip heading levels - start with<h1>
, then use<h2>
, and so on.
All these tag changes may have little or any visual impact but they make your HTML code more semantic and improve SEO optimization as well as the accessibility of your project.
I hope it helps!
Other than that, great job!
Marked as helpful0 - The
- @noelhoppePosted 9 months ago
Hi, some suggestions:
- Remove
body { margin: 25px; }
and replace it withbody { min-height: 100vh; }
- It's good practice to use a normalize.css file to reset browser's default behaviour. For example install with
npm install normalize.css
in Terminal and than link normalize.css to your *index.html file - Remove
main { margin-top: 75px; }
- Instead of using div's try to use HTML semantic elements such as main, element, article, section
<h2>
should be<h1>
because it's the only heading.- "Anual Plan" should be a
<p>
- Remove
margin
fromdiv.payment
and setgap: 20px
todiv.plan
- "$59.99/year" should be in a `<p>``
- Remove
div.space
and give the `div.payment { margin: 0 auto 0 0; } - Remove margin from
div.order
anddiv.plan
- "Proceed to payment" is a
<button>
- "Cancel" is a
<button>
- Remove div containers from "Proceed to payment" and "Cancel" and replace it wiht button and style it with css. Happy Coding
Marked as helpful0@chriszychPosted 9 months agoWow, thanks a lot @noelhoppe, now I know what to correct.
0 - Remove
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