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

Single price grid component with flexbox and grid

shemjay 140

@shemjay

Desktop design screenshot for the Single price grid component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


This is my first ever grid layout and my first grid-flexbox combination. Really excited to see it looking somewhat like the original.

Had some issues with:

  1. How to change the background color for the lower blue content. I used box shadow with an inset value not sure if that is good practice or correct for the solution.

  2. How to properly position elements within a grid-child. What could I do to better position within a grid-child that is also a flexbox container? Is just using margins and padding okay?

  3. Semantic markup. How to include better semantic html

  4. How can I make a grid like this responsive without having to use grif-template-areas?

Leave me a tip for anything else I missed :)

Community feedback

Ahmed Bayoumi 6,740

@Bayoumi-dev

Posted

Hey Shemjay,

1.To change the background color for the lower blue content... Firstly the box-shadow property for shadows... Here you should change the background color of Why Us content to make it lighter not to change the background color of Subscription content.

You need to make the background color of Why Us lighter, Create a pseudo-element ::after as an overlay, and give it the following style:

#content-right {
    //...
   /* Give the parent element `position: relative;` to flow the child element `::after ` on it */
    position: relative;   
}

#content-right::after {
    content: "";
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    background-color: white;
    opacity: 0.15;
}

#content-left {
   /* box-shadow: inset 0px 0px 400px 100px rgba(0, 0, 0, 0.1); */  <---Remove
   //...
}
  1. It is okay but I suggest you instead give each element margin-left: 3.5em to align all at the same level, Give the container that contains all elements padding-left: 3.5em... Don't repeat yourself.

3.Semantic markup... You have accessibility issues that need to fix.

  • Document should have one main landmark, Contain the component with <main>.
<main>
   <div class="wrapper">
      //...
   </div >
</main>
  • Page should contain a level-one heading, Change h4 to h1
<h1 class = "title">Join our community</h1>

You should always have one h1 per page of the document... in this challenge, you will use h1 just to avoid the accessibility issue that appears in the challenge report... but don't use h1 on small components <h1> should represent the main heading for the whole page, and for the best practice use only one <h1> per page.

Heading levels should only increase by one, So all the rest of h4, Change to h2... Ordered headings make it easier to navigate and understand when using assistive technologies.

<h2 class = "section-title-left">Monthly Subscription</h2>
<h2 class = "section-title-right">Why Us</h2>

Some Resources

I hope this is helpful to you... Keep coding👍

Marked as helpful

1

shemjay 140

@shemjay

Posted

@Bayoumi-dev Thanks so much!! This is a huge help will definitely apply all your advice in my next attempt. And the resources too will read them too

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