Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted about 1 month ago

Responsive Recipe Page with Semantic HTML & Modern CSS

Bensolve•100
@Bensolve
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? What I’m Most Proud Of
  • Successfully implemented a mobile-first responsive design that scales fluidly across devices.
  • Used semantic HTML effectively to improve accessibility and SEO.
  • Applied modern CSS techniques like clamp(), CSS Grid, and Flexbox to maintain consistent rhythm and layout.
  • Followed the design mockups precisely, ensuring visual accuracy.
  • Handled complex layout challenges such as image breakouts and spacing issues smoothly.
  • Improved code structure with a BEM-like naming convention, making the CSS maintainable.

What I Would Do Differently Next Time
  • Plan the layout breakouts and overflow behavior earlier to avoid late-stage debugging.
  • Explore CSS container queries for more adaptive design beyond media queries.
  • Automate accessibility testing to catch semantic or ARIA issues sooner.
  • Create reusable CSS utility classes for common spacing to reduce repetition.
  • Use more CSS custom properties (variables) for colors and spacing for easier theming.
  • Write more detailed documentation or comments in CSS for future maintainability.

What challenges did you encounter, and how did you overcome them? Challenges Encountered and How I Overcame Them
  • Image Overflow on Small Screens
    Problem: Images were spilling outside the container on mobile.
    Solution: Used width: 100vw combined with margin-left: calc(50% - 50vw) to make images break out gracefully without causing horizontal scroll.

  • Maintaining Consistent Spacing Across Viewports
    Problem: Padding and margins looked inconsistent between mobile and desktop.
    Solution: Used clamp() for spacing and font sizes to create smooth, responsive scaling instead of fixed values.

  • Semantic Structure Confusion
    Problem: Figuring out the best HTML elements to represent complex content sections.
    Solution: Followed best practices by using main, section, article, and appropriate heading levels (h1, h2, h3) to ensure clear hierarchy and accessibility.

  • Unexpected White Space on the Right Side
    Problem: Horizontal scroll and whitespace appeared on some breakpoints.
    Solution: Debugged container widths and overflow, adjusted margins and padding, and ensured no elements exceeded viewport width.

  • Aligning Layout with Design Mockups
    Problem: Matching exact padding, font sizes, and colors from designs was tricky.
    Solution: Used precise CSS values from the style guide and continuously compared the live build with mockups during development.

  • CSS Naming and Architecture for Maintainability
    Problem: Avoiding messy or overly generic class names.
    Solution: Adopted a BEM-like, component-based naming convention to keep CSS organized and scalable.


What specific areas of your project would you like help with? Areas Where I Would Like Help
  • Optimizing Responsive Typography
    I use clamp() and vw units for fluid scaling, but I want feedback on whether my approach balances readability and performance across all devices effectively.

  • Image Breakout Techniques
    I’m using width: 100vw and negative margins for images to break out on mobile. Are there more modern or cleaner methods to achieve this without causing layout shifts or overflow?

  • CSS Architecture & Naming
    I follow a BEM-like naming pattern, but I’d appreciate advice on improving class structure for better scalability and maintainability, especially in larger projects.

  • Semantic HTML Validation
    Would love feedback on my use of semantic elements (main, section, article, heading hierarchy). Are there improvements I can make to boost accessibility or SEO?

  • Handling Edge Cases in Layouts
    Any tips on managing tricky responsive edge cases, like avoiding horizontal scroll on complex nested containers or dynamically sized elements?

  • Performance Best Practices for CSS
    Suggestions on minimizing CSS complexity or improving load/render times without sacrificing design fidelity.


Feel free to review specific snippets or sections of my code if that helps provide more targeted advice!

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Marzia Jalili•8,410
    @MarziaJalili
    Posted about 1 month ago

    Flawlessly written! 👑

    🌟 A teeny tiny tweak?

    ✅ You can use the padding shorthand property to update the code below:

    padding-block: 0.75rem;
    padding-inline: 0;
    

    ✅ Updated code:

    padding: 0.75rem 0;
    

    The code is solid-bulletproof! 🔥🔥🔥

    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
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