Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

QR code component

@felixgn9

Desktop design screenshot for the QR code component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


What CSS codes do I need to make it even better? Where can I learn CSS and JS?

Community feedback

@elioflo

Posted

Hello,

Your solution is excellent - it has a simple HTML structure and styling, and looks great!

I can offer you some advice or alternative methods to style your CSS:

  • To center an element, you can use either flex or grid. If you choose to use grid, it can be achieved in just two lines of code:
body {
    display: grid;
    place-items: center;
}
  • If you know that all child elements have the 'text-align: center' property, you can set this property to their parent element. In this case, you can set this property to the main element and remove it from the p and h1 elements.".
main {
    // code ....
    text-align: center;
}
  • For img element:
    • The default value for the height property is 'auto', so it can be omitted if you want to use the default value.
    • If you are not moving the element from its default position, using the 'position: relative' value is not necessary.
    img {
        width: 100%;
        border-radius: 10px;
    }
    

I hope my tips are helpful to you. Keep up the good work!

Elio Flores

Marked as helpful

0

@felixgn9

Posted

@elioflo thanks...that's really helpful. Now I can use less code

0

@savvystrider

Posted

The "Resources" (https://www.frontendmentor.io/resources) section of Frontend Mentor has a list of different resources to learn CSS and JS.

0

Please log in to post a comment

Log in with GitHub
Discord logo

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