Design comparison
Solution retrospective
Hello everyone First Time using BEM Method any feedback ?
Community feedback
- @vanzasetiaPosted almost 3 years ago
š Hi Mansour!
š Congratulations on finishing this challenge! I have some feedback on this solution:
- Accessibility
- Every page should contain only one
h1
. In this case, you make theh1
toh2
and if you want, you can have a hiddenh1
withsr-only
styling (screen-reader only or visually hidden). - Create a custom
:focus-visible
styling to any interactive elements (button
, links,input
,textarea
). This will make the users can navigate this website using keyboard (by usingTab
key) easily. - The
Learn More
buttons should be link elements. They commonly will navigate the user to the different web pages. - Keep in mind that anchor tags are for navigation - moving to different pages or content on the same screen, while the
button
elements are for actions like opening a modal, submitting a form, toggling element, etc. - Next time if you are going to use
button
tag, always specify thetype
of thebutton
. In this case, you can set the type of them astype="button"
. By doing that, you prevent the button from behaving unexpectedly (like submitting). - For any decorative images, each
img
tag should have emptyalt=""
andaria-hidden="true"
attributes to make all web assistive technologies such as screen reader ignore those images. In this case, all images are decorative only. - Some resources to learn about the alternative text.
- Use
rem
or sometimesem
unit instead ofpx
. Usingpx
will not allow the users to control the size of the page based on their needs.
- Every page should contain only one
- Styling
- I would recommend using
rem
orem
units forpadding
.%
can cause a lot of issues when the screen is too small or too large (since there's nomax-padding
property, it will keep growing).
- I would recommend using
- BEM
- Why don't make the
<button class="btn btn__orange">Learn More</button>
the same as the<div class="card card--orange">
? - You can make the below markup to be the elements of the
card
.
- Why don't make the
<div class="content"> <p class="text"> Choose a sedan for its affordability and excellent fuel economy. Ideal for cruising in the city or on your next road trip. </p> </div>
That's it! Hopefully, this is helpful!
Marked as helpful1@Mansour0007Posted almost 3 years ago@vanzasetia could you explain more this part BEM Why don't make the <button class="btn btn__orange">Learn More</button> the same as the <div class="card card--orange">?
You can make the below markup to be the elements of the card.
<div class="content"> <p class="text"> Choose a sedan for its affordability and excellent fuel economy. Ideal for cruising in the city or on your next road trip. </p> </div>0@vanzasetiaPosted almost 3 years ago@Mansour0007 About the first point, I meant you could make the
btn
as the block element andbtn--orange
as the modifier class (instead ofbtn__orange
).The second point, I was talking about, I would recommend making the
content
andtext
element as the children element of the card. So, the class name should becard__content
andcard__text
.Marked as helpful1@Mansour0007Posted almost 3 years ago@vanzasetia okay i get it now thank you very much
0 - Accessibility
- @Mansour0007Posted almost 3 years ago
Thank you Vanza Setia, I'm really grateful that you highlighted all of these points so i can learn from them. very helpful feedback and i will be working to improve in all of these areas Thank you
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