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

Mobile first Workflow, CSS Grid

Gilang Adityaβ€’ 385

@madegilangaditya

Desktop design screenshot for the Four card feature section coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


I used display grid to make the column and add position:relative; top: -50%; If there any best practice to do it, please kindly add in comment. Thank your

Community feedback

P
Graceβ€’ 27,870

@grace-snow

Posted

Hi

This looks good and the html is spot on!

I recommend some changes to how you are writing scss.

You are nesting very heavily at the moment. As well as making it very hard to read, you're really increasing specificity there and it is not recommended.

Instead, try writing your scss where you only nest pseudo states, pseudo selectors, media queries or direct children selectors.

// eg. Instead of this 
.my-class {
  // styles
  .child-class {
    p {
     ... 
    } 
  } 
} 

// Try this
.my-class {
  // styles

  @media-query... {
    ... 
  } 
} 

.child-class {
  ... 
} 

I can't understand what you're doing with the grid and position relative I'm afraid. The whole point of css grid is you create the grid template and let that handle the layout, sizes and spacing of the grid children. It sounds like you are breaking children out of their grid position unnecessarily. Create the grid and place the cards on it where they need to be.

Last pointer - make sure you put the font size on the body in rem not px. Never put font size in px as it cannot scale for people with different zoom settings.

I hope this helps.

1

Gilang Adityaβ€’ 385

@madegilangaditya

Posted

@grace-snow thanks for your suggestion grace, I will fix my SCSS for future challenge. I use position relative because I didn't figure out how to make the grid column position more to the top.

0
P
Graceβ€’ 27,870

@grace-snow

Posted

Learn more how to use grid. You need to plan out the grid and set up rows and columns. Maybe look into grid-template areas too you might find that easier

0
Gilang Adityaβ€’ 385

@madegilangaditya

Posted

@grace-snow thanks grace I will look it up..

0
Roc Tanweerβ€’ 2,500

@RocTanweer

Posted

@grace-snow Hello, how deep nested should be in sass? And what to do if it goes any deeper?

I totally follow BEM and 4-5 level nesting is very common in my code...

Please help me

0
P
Graceβ€’ 27,870

@grace-snow

Posted

@RocTanweer I rarely go deeper than 1-2 levels. I only nest media queries and pseudos usually.

Even if you follow an approach of a parent class with element selectors, there is no good reason to nest deeper than 3 levels I think

0
Roc Tanweerβ€’ 2,500

@RocTanweer

Posted

You did really good, Almost pixel perfect πŸŽ‰ there are multiple ways to do the same job...

Every developer has their own way to complete a task

Good luck πŸ˜ƒ

1

P
j5β€’ 2,290

@jmnyarega

Posted

@RocTanweer Agreed πŸ˜‚

0
Gilang Adityaβ€’ 385

@madegilangaditya

Posted

@RocTanweer thanks man really apreciate

1
P
j5β€’ 2,290

@jmnyarega

Posted

Using position is also an acceptable approach. I used grid layout & it worked as well.

1

Gilang Adityaβ€’ 385

@madegilangaditya

Posted

@jmnyarega thanks for your feedback

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