Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

3 column preview with Flexbox

Hum Bruno 230

@humbruno

Desktop design screenshot for the 3-column preview card component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


  • My biggest takeaway (and proudest achievement) on this one was being able to write reusable classes that allowed me to style each card on a global scale and just add individual tweaks to each one. As such, I needed some clear, but descriptive, class names. What are you preferences or conventions for creating class names for reusable classes?

  • Something that I have been noticing with the challenges of Frontend Mentor is that my solution doesn't always have the same width or height as the design files. Do you hard code the width and height of the containers to match the design (for example setting width: 900px) or just allow the container to naturally grow/shrink and adjust the content size instead?

Community feedback

PhoenixDev22 16,950

@PhoenixDev22

Posted

Hello @humbruno ,

I have some suggestions regarding your solution:

  • First of all, You are misusing the <section> tag .This doesn't need any sections, section is not meant to be used as a containers. section is for a bigger chunk of content often titled by <h2>.

  • Use <p> to wrap the class="car__description".

  • For any decorative images, each img tag should have emptyalt=""and aria-hidden="true" attributes to make all web assistive technologies such as screen reader ignore those images. In this case, all images are decorative only.

  • swap the buttons for anchor tags. Clicking those "learn more" buttons would trigger navigation not do an action so button elements would not be right.

  • you can add a <h1> with class="sr-only" (Hidden visually, but present for assistive tech). And use <h2> for the heading.

.sr-only {
	border: 0 !important;
	clip: rect(1px, 1px, 1px, 1px) !important;
	-webkit-clip-path: inset(50%) !important;
		clip-path: inset(50%) !important; 
	height: 1px !important;
	margin: -1px !important;
	overflow: hidden !important;
	padding: 0 !important;
	position: absolute !important;
	width: 1px !important;
	white-space: nowrap !important;            
}

  • It would be like this:
 <div class="card card--suvs">
              <img src="images/icon-suvs.svg" alt=""  aria-hidden="true"/>
              <h2 class="">SUVs </h2>
            <p class="car__description">
              Take an SUV for its spacious interior, power, and versatility.
              Perfect for your next family vacation and off-road adventures.
             </p>
             < a href="#" class=""> Learn More</a>       
    </div>

  • Never use px for font-size.

  • You should use em and rem units .Both em and rem are flexible, Using px won't allow the user to control the font size based on their needs.

Overall , your solution is good . Hopefully this feedback helps

Marked as helpful

0

Hum Bruno 230

@humbruno

Posted

@PhoenixDev22 Thank you! That's great input and I'll definitely keep in mind for the next one :)

0
Naveen Gumaste 10,460

@NaveenGumaste

Posted

Hay ! Hum Bruno Good Job on challenge

These below mentioned tricks will help you remove any Accessibility Issues

-> Add Main tag after body <main class="container"></main>

-> Always use h1 first and then h2, h3 and so on

-> Learn more on accessibility issues

If this comment helps you then pls mark it as helpful!

Have a good day and keep coding 👍!

Marked as helpful

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join 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