Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted about 3 years ago

Huddle landing page with a single introductory section

Sahil Sharma•110
@sahil899
A solution to the Huddle landing page with a single introductory section challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


Q1 I have use css grid is It correct or should I have gone with flex box? Q2 please check my media query and is there any better way to optimize them.

Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

  • Fluffy Kas•7,655
    @FluffyKas
    Posted about 3 years ago

    Hiyo,

    Both grid and flexbox can be used for this challenge so whatever suits you. On the other hand, if you're not sure what you're doing with grid, it can get real messy. Flexbox might be a bit easier to understand for newbies. From what I can see in your code, you might want to check out some grid learning resources (I can recommend some if you don't know any).

    But to provide some quick fix:

    1. Remove grid-auto-rows and auto-columns, they do nothing for you here.

    2. Change your height to min-height: 100vh (you don't want to lock your website to a fixed height). This will reveal some additional problems: having some extra rows in your solution. Just get rid of the grid-template-rows altogether and it will be fine, you don't really need to define them here.

    3. Change the width on your body to max-width. Don't use % or vw for this, as it will stretch and stretch your solution as the screen size gets larger. Use rems instead. Or a combination of width and max-width can also work, like this: width: 90%, max-width: 100rem (this is just a guess, may not be the best width in this case, but you get the idea).

    To answer your second question, your media query seems perfectly fine. If you wanna optimise it, try a mobile-first workflow and use min-width in your next project. That way you usually can get away with writing less code and it's considered best practice.

    There are some other things to be aware of:

    1. Don't set width: 50vw on images. It's the best to use the following code most of the time: max-width: 100%,height: auto, display: block. This ensures that your image scales properly, no matter the screen size.

    2. Adding a background-size: cover to the body would make sure the bg image covers the whole screen nicely.

    3. You could wrap your social media images in a tags (as they're links) and then add aria-labels and cursor: pointer to them.

    4. Add a cursor: pointer to your button as well.

    5. Wrap your main content in main (so everything apart from the header and footer).

    There's a few other small bits, but all in all, just look up grid/flexbox a bit. ^^ I found, this isn't actually a very easy challenge to do layout wise so you did well! Good luck!

    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 1st-party linked stylesheets, and styles within <style> tags.

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.

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub