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

Responsive omelette recipe page created with HTML and CSS

Priscillia Egbo (Althea Storm)•10
@altheastorm
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 am most proud that I was able to make the recipe page responsive on most, if not all, devices. I am also proud that I was able to get the design as close to the designs I saw in the Figma documents.

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

I designed the page first for desktop, so using media queries to redesign it for mobile proved challenging. I created a container with a white background (where the main content is situated) for the desktop version, so turning that container into the entire page for the mobile version and readjusting the design parameters of all the other elements to fit it was a bit difficult. I'm not even sure I did it right.

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

I would like help with using media queries to make a desktop-first design mobile-responsive.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • princemuel•135
    @princemuel
    Posted 7 months ago

    Hi there.

    I've checked out your code and overall, it looks good.

    • It uses semantic HTML.
    • The layout looks good on all screen sizes👌
    • It is well-structured, readable...you'll need to work on reusability.
    • The solution is close to the design and that's great. Chasing the Pixel-Perfect Dream
    • On accessibility, some suggestions, always wrap the page content inside a landmark e.g the main element. Some other landmarks are article, footer, section(useful when coupled with aria-label or arialabelled-by).

    Concerning, your request for help with making the project mobile responsive, why not try building it mobile first i.e write the base styles for mobile, then as the screen widths change, you update the relevant styles.

    I see you made some updates to the recipe container's styles at each breakpoint...You could instead, create a dedicated container class with an absolute max-width say 1440px(convert to rem), a width of 100% with some padding, maybe 1 or 2rem, and a margin-inline of auto to always center the content.

    I guess you already know some of this.

    You can either use it to wrap each section, or the whole content.

    Using it in this project should get you from mobile, all the way to the desktop without writing any media queries except for maybe font-sizes etc.

    Speaking of font-sizes, since you're familiar with css variables, you could create a typescale in :root:

    :root {
      --base-size: 1rem; /* normally 16px */
      --scale: 1.25; /* adjust to your preferred */
      --h1: calc(var(--h2) * var(--scale));
      --h2: calc(var(--h3) * var(--scale));
      --h3: calc(var(--h4) * var(--scale));
      --h4: calc(var(--h5) * var(--scale));
      --h5: calc(var(--h6) * var(--scale));
      --h6: var(--base-size);
    }
    
    /* then do something like this  */
    body {
      font-size: var(--base-size);
    }
    h1 {
      font-size: var(--h1);
    }
    
    /* then at breakpoints..adjust to your preferred  */
    /* tablet */
    @media only screen and (max-width: 768px) {
      --base-size: 1.3rem;
    }
    
    /* and so on */
    

    This way, all you're adjusting is the scale or the base size at each screen size.

    Anyways, good luck✌️

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
Frontend Mentor logo

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