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

https://www.w3schools.com/css/css_margin.asp

bootstrap
Opeyemi Ayomide Isaac•10
@ayomithefirst1
A solution to the QR code 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?

What I'm Proud Of: Clean and Simple Design: I managed to create a neat, visually appealing layout that is both functional and aesthetically pleasing. The QR code is the focal point, and the text is well-aligned and easy to read. Responsive Layout: Using CSS, I centered the content both vertically and horizontally without relying on complex frameworks. This ensures that the page looks good on different screen sizes. Custom Styling: I added subtle custom styles, like rounded corners on the QR code image, which makes the design feel polished. Meeting Project Requirements: I followed the given design challenge from Frontend Mentor and made sure all elements, including the QR code, text, and attribution, were positioned correctly, meeting the brief. What I Would Do Differently Next Time: Accessibility Improvements: I could improve the accessibility of the project by ensuring that all interactive elements (like links) are clearly distinguishable for screen readers and users with visual impairments. CSS Optimization: Although the CSS is functional, I could have explored more advanced techniques, like using CSS Grid or Flexbox for even more flexibility with the layout. Interactive Features: I could add some interactivity, such as hover effects or animations, to enhance the user experience, making the page feel more dynamic. Mobile Optimization: While the page is responsive, I could use media queries to refine the mobile experience, ensuring that the text and image resize properly on smaller screens.

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

Aligning Content Without a Framework:

One of the challenges was ensuring that the content (QR code and text) was centered properly without relying on a framework like Bootstrap. It required experimenting with CSS grid and flexbox techniques to achieve the perfect centering of the elements both vertically and horizontally. How I Overcame It:

I used display: grid and place-items: center on the body tag, which is a simple and effective way to center content in modern browsers. This allowed me to avoid any unnecessary complexity and keep the layout responsive across different screen sizes. Ensuring Responsiveness:

Another challenge was making sure the design was responsive and looked good on various screen sizes, especially with the image and text scaling properly. How I Overcame It:

I set the image to have a max-width: 100% and adjusted the width of the container to a fixed size, ensuring it doesn't overflow. This helped the layout scale well, particularly for smaller screens. Maintaining Design Consistency:

While styling the page, I had to ensure the design remained consistent with the provided brief. It was important to keep the proportions of the QR code and text balanced while not crowding the layout. How I Overcame It:

I adjusted the padding and margin values, ensuring the spacing between the elements was visually pleasing. I also used a combination of font-size and line-height to ensure readability and a clean visual hierarchy. Custom Fonts and Styling:

The challenge of integrating custom fonts and specific styling for the text (like using the "Sour Gummy" font) required importing the correct font and testing how it rendered across different browsers. How I Overcame It:

I ensured that the custom font was available and checked the layout in various browsers to ensure it rendered correctly. Additionally, I tested the overall legibility of the font size and style to make sure it was clear and easy to read.

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

Responsive Layout:

"I am having trouble ensuring that the QR code image and text scale properly on smaller screens. Can you provide feedback on my CSS for responsiveness, especially for mobile screens?" Centering Content:

"I'm trying to center the content (QR code and text) both vertically and horizontally. I've used display: grid and place-items: center, but I'm not sure if this is the most efficient way. Do you have any suggestions on how to improve this, or is there a better way to achieve this?" Accessibility:

"I want to make sure my project is accessible. What are some best practices for improving accessibility in this type of design? Specifically, how can I improve the contrast for users with visual impairments, and should I include ARIA labels for the image or links?" Text Styling and Readability:

"I'm not sure if the font size and line height of my text are optimal for readability. Could you provide feedback on my current text styling (font-size, line-height, font-family)? How can I ensure the text is legible on all screen sizes?" Custom Fonts:

"I included a custom font (Sour Gummy), but I'm unsure if it's loading properly or if there's a better way to load it for cross-browser compatibility. Could you help me with the correct way to import and apply a custom font?" Cross-Browser Compatibility:

"I have noticed some minor differences in how the page appears in different browsers (Chrome vs. Firefox). How can I ensure consistent styling across multiple browsers? Are there any CSS properties that may not be supported in all browsers?" CSS Optimization:

"I'm wondering if my CSS can be optimized. Are there any performance improvements or techniques (like using shorthand properties or reducing redundant styles) that I can apply to make the code more efficient?"

Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on Opeyemi Ayomide Isaac's solution.

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.