Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted 10 months ago

Mobile First Responsive Page With Flexbox

jyoshida93•120
@jyoshida93
A solution to the Recipe page challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


What are you most proud of, and what would you do differently next time?

I'm proud I stuck with this challenge and actually submitted it for review. I started off with desktop in mind before considering the mobile design. I got my code specifically my layout into a bad state and decided to start over with a mobile first approach. This worked better so I'll probably approach future problems mobile first.

What challenges did you encounter, and how did you overcome them?

My biggest challenge was getting the general layout to work for desktop and mobile. As I mentioned in the previous question restarting with a mobile first design approach helped. Another challenge was getting the nutrition table to work. I initially tried getting it to work with grid but found it hard to get the bottom border to work. I got stuck so I tried using a flexbox instead and that approach worked better for me.

What specific areas of your project would you like help with?

I really struggled with getting the layout to work for different screen sizes so any advice on that would be great. Also my CSS file is mess and I'm not sure how to structure the general layout of the file ie do I put element selectors above class selectors file etc.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Dominic•170
    @Dpal88
    Posted 10 months ago

    Hi @jyoshida93,

    Great job on completing this challenge!

    And your solution does a great job of matching the design, but I have few tips that could make it even better!

    1. Right now I think your design looks great on larger screens, however there is one small issue on mobile screens where the image is not scaling properly. This can be easily fixed though by simply removing the height property from the image.

    2. As far as organizing your CSS file goes, there's not a right or wrong way of doing things. But I would suggest looking into some different CSS methodologies, which are essentially CSS coding guides that take a very structured approach to writing and organizing CSS. One of the most popular methodologies that I see people using is BEM (Block, Element, Modifier), I'll leave a link below if you are interested in reading more about this.

    https://getbem.com/introduction/

    However, for smaller projects I would say it doesn't matter to much how you go about organizing you CSS file as long as you are keeping things consistent. I would also recommend adding comments to your code. These can be used to divide your stylesheet into sections, explain complex styles, etc.

    3. Also I noticed that your bulleted lists & numbered lists do not have the correct colors set. To target the actual bullets and numbers you can use the CSS ::marker pseudo-element.

    I hope this helps, and if you have any questions feel free to message me!

    Marked as helpful

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

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

How does the accessibility report work?

When a solution is submitted, we use axe-core to run an automated audit of your code.

This picks out common accessibility issues like not using semantic HTML and not having proper heading hierarchies, among others.

This automated audit is fairly surface level, so we encourage to you review the project and code in more detail with accessibility best practices in mind.

How does the CSS report work?

When a solution is submitted, we use stylelint to run an automated check on the CSS code.

We've added some of our own linting rules based on recommended best practices. These rules are prefixed with frontend-mentor/ which you'll see at the top of each issue in the report.

The report will audit all CSS, SCSS and Less files in your repository.

How does the HTML validation report work?

When a solution is submitted, we use html-validate to run an automated check on the HTML code.

The report picks out common HTML issues such as not using headings within section elements and incorrect nesting of elements, among others.

Note that the report can pick up “invalid” attributes, which some frameworks automatically add to the HTML. These attributes are crucial for how the frameworks function, although they’re technically not valid HTML. As such, some projects can show up with many HTML validation errors, which are benign and are a necessary part of the framework.

How does the JavaScript validation report work?

When a solution is submitted, we use eslint to run an automated check on the JavaScript code.

The report picks out common JavaScript issues such as not using semicolons and using var instead of let or const, among others.

The report will audit all JS and JSX files in your repository. We currently do not support Typescript or other frontend frameworks.

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub