Design comparison
Solution retrospective
Hi everyone, I would like to know how can I achieve mobile first workflow in CSS?
Community feedback
- @BlackpachamamePosted 10 months ago
Greetings! you have done a great job š
š Some accessibility and semantics recommendations for your HTML
- To improve the semantics of your HTML, you can change your
<div class="attribution">
to a<footer class="attribution">
š Some suggestions
- Use
min-height
andmax-width
, this will help the content stretch or shrink if you need to. Unlikeheight
andwidth
which can cause your content to be cut off on certain screens - Do not use
%
forwidth
orheight
. Better userem
,em
orpx
- You can apply
display: block
to the image to remove the white space generated underneath. Although visually in this case it is irrelevant, it helps you better calculate the space with other elements - You can apply
margin
andpadding
in yourmain-container
, thediv
withcontainer
class is not necessary
Marked as helpful2@leamsi-ciberPosted 10 months agoThanks Marcos, I appreciate your feedback.
I will take your recommendations to build better html and css code šš½
1 - To improve the semantics of your HTML, you can change your
- @RevazSologhashviliPosted 10 months ago
Hi Ismael,
Mobile first design is achieved by using media queries.
like this, first body element styling is for mobile devices and others are for different types of device widths.
check out this MDN link for detailed examples.
body { background-color: #fff; font-size: 16px; line-height: 1.5; } /* Media query for tablets */ @media (min-width: 768px) { body { font-size: 18px; } } /* Media query for desktops */ @media (min-width: 1024px) { body { font-size: 20px; } }
Marked as helpful2@leamsi-ciberPosted 10 months agoThank you @RevazSologhashvili
Now I understand, the resource was really helpful.
0 - @danielmrz-devPosted 10 months ago
Hello Ismael!
Your solution looks excelent!
I have just one suggestion:
- In order to make your HTML code more semantic, use
<h1>
for the main title instead ofh2
. 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.This change has little or not effect at all on the project, but it makes your HTML code more semantic, improving SEO optimization as well as the accessibility of your project.
I hope it helps!
Other than that, you did a great job!
Marked as helpful1@leamsi-ciberPosted 10 months agoThank you, Daniel. I realized I was using <h2> for the size, not for the heading. Your suggestions were really helpful!
1 - In order to make your HTML code more semantic, use
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