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

A responsive Order summary component card built with HTML and CSS

Taophyc•360
@Taophycc
A solution to the Order summary component 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've just completed another challenge

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

I had problem creating the payment container

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

I opened the live url website on chrome and safari, then I discovered that some elements of the design on safari were not styled properly but it was fine on chrome. I need help with this.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Brian Muniz Silveira•200
    @BrianMunizSilveira
    Posted 7 months ago

    Solution Retrospective: Order Summary Component Challenge

    What Are You Most Proud Of, and What Would You Do Differently Next Time?

    Great job completing another challenge! Your implementation demonstrates good use of CSS Flexbox and media queries to create a responsive design. It’s also commendable that you’ve styled the component effectively to align with the provided design.

    Next time, you might want to focus on cross-browser compatibility earlier in the development process to identify and address inconsistencies between browsers like Chrome and Safari.


    What Challenges Did You Encounter, and How Did You Overcome Them?

    You mentioned facing an issue with the payment container. Your current approach shows progress in styling it effectively, but it could benefit from some fine-tuning, especially with spacing and alignment. It’s great that you managed to style the element as intended after some adjustments.

    Additionally, the styling differences between Chrome and Safari are a common challenge. Addressing these requires understanding how different browsers interpret CSS properties and testing on multiple platforms during development.


    Suggestions for Improvement

    Here are some recommendations to enhance your project:

    1. Fixing Cross-Browser Styling Issues

    Safari and Chrome sometimes interpret CSS differently, especially with flexbox and spacing. Here are a few strategies:

    • Check flex Property Behavior: Safari might require explicit settings for align-items and justify-content to render elements properly.
    • Vendor Prefixes: Use a CSS autoprefixer tool to ensure compatibility with older browser versions. For example:
      display: -webkit-flex; /* Safari fallback */
      display: flex;
      
    • Test Specific Properties: Padding, margin, and overflow properties may behave differently. Test by setting consistent box models using box-sizing and inspecting layout differences in developer tools.

    2. Refine the Payment Container

    Your current payment container layout works, but you can enhance alignment and responsiveness:

    • Align Text and Icon Properly: Ensure the text and icon stay aligned vertically and adjust spacing for cleaner visuals. Example update:
       .payment-container {
        display: flex;
        align-items: center; /* Aligns items vertically */
        justify-content: space-between; /* Creates proper spacing */
        padding: 1rem; /* Adds internal spacing */
    }
    
    .music-icon {
        width: 3em;
        height: 3em;
        margin: 0; /* Reset unnecessary margins */
    }
    
    .payment-container p {
        margin: 0; /* Removes excess margins */
    }
    
    a {
        text-decoration: underline; /* Ensures consistent link style */
        font-weight: bold;
    }
    

    3. Enhance Mobile Responsiveness

    Your mobile styles are well-implemented, but consider tweaking button sizes and spacing for smaller screens:

    @media screen and (max-width: 450px) {
        .btn {
            padding: 1em 4em; /* Adjust padding for smaller screens */
        }
    
        .payment-container {
            width: 100%; /* Make the container full-width */
        }
    
        section > p {
            font-size: 0.875rem; /* Improve text readability on smaller screens */
        }
    }
    
    

    4. Add Hover and Focus Effects

    Enhancing interactivity with hover and focus effects can improve the user experience:

    .btn:hover {
        filter: brightness(90%);
    }
    
    a:hover {
        color: hsl(245, 75%, 52%);
        text-decoration: none;
    }
    

    5. Comment Your CSS for Clarity

    Adding comments to your CSS improves readability and helps with collaboration. For example:

    /* Main container for the card */
    .parent-container {
        background: url(pattern-background-desktop.svg);
        background-color: hsl(225, 100%, 94%);
        min-height: 100vh;
        display: flex;
        justify-content: center;
        align-items: center;
        background-repeat: no-repeat;
        background-size: contain;
    }
    

    Summary

    Your implementation is strong, with a responsive layout and well-structured HTML and CSS. By addressing cross-browser issues, refining responsiveness, and adding interactive details, you can elevate your project even further.

    Keep testing and improving! The more challenges you take on, the stronger your skills will become. 🚀😊

    Brian.

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