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

All comments

  • @lab1210

    Submitted

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

    i had challenges with centralizing on the page which I overcame by consulting stack overflow.

    @Propowershell

    Posted

    Hi, nice looking component, this should help you improve it:

    Every webpage needs a <main> that wraps all of the content, except for <header> and footer>. This is vital for accessibility, as it helps screen readers identify a page's "main" section. Wrap the card in a <main>.

    Besides for the card, you don't need any divs in this challenge, so I would simplify your HTML structure to this:

    <main> <div> <img> <h2></h2> <p></p> </div> </main> The alt text must also say where it leads(the frontendmentor website). A good alt text would be "QR code leading to the Frontend Mentor website."

    Headings should always be in order, so you never start with a <h3>. I would change the heading to a <h2> - a page should only have one <h1>, reserved for the main heading. As this is a card heading, it would likely not be the main heading on a page with several components.

    CSS:

    Use the style guide to find the correct background-color.

    Remember to specify a fallback font:font-family: 'Outfit', sans-serif;.

    I like to add 1rem of padding on the body, to ensure the card doesn't touch the edges on small screens.

    Remove the margin on the card.

    To center the card vertically, add min-height: 100svh and justify-content: center on the body.

    Remove all widths in px.

    Add a max-width of around 20rem on the card, to prevent it from getting too wide on larger screens.

    line-height and letter-spacing should not be in px. Use % for the line height and em for the letter spacing, where 1em equals the font size of the element.

    Paragraphs have a default value of font-weight: 400, so there is no need to declare it.

    On the image, add display: block and max-width: 100% - the max-width prevents it from overflowing its container.

    0
  • @dearestalexander

    Submitted

    What are you most proud of, and what would you do differently next time?

    I feel like setting the main frame of the card as a flexbox, and utilising flex alignment settings along with padding makes it easy to add the various inner elemements with minimal CSS adjustments to them.

    I also set up all the colours and the base paragraph font as variables. I then used calc() to adjust font across elements based on the base paragraph variable rather than using rem or %. I felt this approach makes it easier to adjust on a relative basis to the base paragraph.

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

    No major challenge. Variable fonts were new, so it was a learning experience to find out how to reference them in CSS.

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

    I was wondering about good practices on images within containers.

    In this exercise I kept default content box settings and I use a width and padding on the container. It was then easy to specify the same width for the image element.

    But from a responsiveness point of view, is this the best way to approach images. Specifying width in px of image and container, or is there a better way to do this. For example I remember there is object-fit which can crop an image to fit a container, would this have been better?

    @Propowershell

    Posted

    Your approach works, but for better responsiveness, it's typically more efficient to avoid setting widths in px, as this can make scaling difficult on different screen sizes. Instead, using percentage-based widths or relative units like vw (viewport width) is more flexible. For instance:

    css .container { width: 100%; padding: 20px; }

    img { width: 100%; height: auto; }

    
    This allows the image to scale with its container while maintaining its aspect ratio, making it responsive without the need for fixed pixel values.
    
    Regarding `object-fit`, it's indeed a useful property when you want the image to fill a container while maintaining its aspect ratio or when you want to crop the image. For example, using `object-fit: cover` will ensure the image fills the container, potentially cropping it, while `object-fit: contain` will maintain the entire image within the container.
    
    So, for best practices:
    - Use fluid layouts (percentages or `vw` for widths).
    - Use `object-fit` when you need images to behave more flexibly in varying container sizes.
    - Consider setting `max-width` to prevent oversized images on larger screens.
    

    Marked as helpful

    0
  • @pudding-shark

    Submitted

    What are you most proud of, and what would you do differently next time?

    I'm happy that I finally did a challenge

    I need to plan better and learn more about the fundamentals

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

    I struggled with centering the divs and the image and I did not know how to use margins and paddings

    I searched a lot of questions on google and learnt from them

    Once I was completey stuck and didn't understand why the image wasn't centered properly, I watched a video of the solution and this taught me about css variables and the max-width property, it also taught me why the align-item property wasn't working

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

    I did not really pay attention to the accessibility, and I would like to know how to make it accessible

    I want to know how to make my code more efficient or readable, or if there's some shortcuts and what are the best practices, should I use other units instead of px

    And how do I layout the html

    @Propowershell

    Posted

    Hello Pudding-Shark, You're QR code component is looking good so far but there are just two things I wanted to point out.

    1. The "Improve" in the heading element seems to be in serif font, maybe you should place the import link (<link href='https://fonts.googleapis.com/css?family=Outfit' rel='stylesheet'>) in the head tag in the HTML file.

    2. Use Slate 900: hsl(218, 44%, 22%) for the heading element's color(it's recommended you use a h2 element since it's not the first heading tag in the page.

    Other than that it's great.

    0