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

First time using CSS Grid And SCSS

Mahmoud Samy• 20

@ibnsamy96

Desktop design screenshot for the Base Apparel coming soon page coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


I was wondering, Is there another way to achieve this design other than CSS Grid?

Community feedback

Adler G Luders• 1,580

@adluders

Posted

@ibnsmay96; yes, you can definitely do this with flexbox. I think grid might be the smartest and easiest approach for the wrapper but it can be done with flex as well. Great job overall though. I know, from experience, this challenge can be tricky so really well done on completing it.

Marked as helpful

1

Mahmoud Samy• 20

@ibnsamy96

Posted

@adluders But how to achieve changing sections order in flexbox? It's possible but not in the way the challenge wanted. As described in the next image, The challenge wanted sections order to change in the mobile view. https://ibb.co/6nJQXPs

1
Martha• 510

@Mtc-21

Posted

@ibnsamy96 Use the order property on the flexible element you want to change

0
Adler G Luders• 1,580

@adluders

Posted

@ibnsamy96, @mtc-21 answered below. There is an order property in CSS which you can use to dictate what order something gets displayed as. The main pitfall with it it's I don't believe it's accessible

0
Mahmoud Samy• 20

@ibnsamy96

Posted

@Mtc-21 @adluders I know about the flexbox order attribute but if you saw how the design should be in the mobile view, you would find that at using flexbox, it needs to change HTML elements structure in the mobile view, not just the css values. To make my point clear, let's assume that we structred our html code like that:

<main>
    <div>
        <img src="logo.png"/>
        <div>We're Coming Soon</div>
    </div>
    <img src="girl-image.jpg"/>
</main>

And we used the next css rules in the desktop view:

main{
    display:flex;
    flex-direction:row;
}

In this case, using flex-direction in mobile view to be a column won't help as it will put the content in a vertical way ( logo => content => girl-image ). And if we changed orders we can make it ( girl-image => logo => content ) not ( logo => girl-image => content ) as the html structre prevents us from doing so.

I don't know if I'm still missing the point 😕

2
Adler G Luders• 1,580

@adluders

Posted

@ibnsamy96 that's a good point, maybe I was mistaken. I think it is possible with flex but I'd have to sit at my computer and test it out. I feel like maybe having everything as an individual div and play with the heights should work but I can't test it to know for sure. I'll test my theory out when I get on my computer and will let you know how my experience goes.

Marked as helpful

2
Martha• 510

@Mtc-21

Posted

@ibnsamy96 see the example, I hope this helps you, link in one of the challenges use this property, if you want you can see it this type of designs is better to work with grid and do not have to complicate in the relocation of the elements, because with grid-column and grid-row decide where the only one, to change the resolution with a media query

0
Mahmoud Samy• 20

@ibnsamy96

Posted

@adluders Great, I'll try to test it too.

0
Adler G Luders• 1,580

@adluders

Posted

@ibnsamy96 How did it go?

0
Martha• 510

@Mtc-21

Posted

@ibnsamy96 Hi, how are you doing? Just in the challenge I posted yesterday, I used flexbox and order in the form to change the order of the span tag.

Marked as helpful

0
Mahmoud Samy• 20

@ibnsamy96

Posted

@Mtc-21 @adluders, Thanks for you both. I achieved the same result using float in the desktop view and flexbox with its order property in mobile view. https://codepen.io/ibnsamy96/full/VwzyXwj

0

Adler G Luders• 1,580

@adluders

Posted

@ibnsamy96 ayye glad you found an alternative solution

1

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