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

flexbox, custom variables, pseudo-elements, pseudo-classes

Jason Burke•170
@JasonPBurke
A solution to the Blog preview card challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)
Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • P
    Kamran Kiani•2,780
    @kaamiik
    Posted 5 months ago

    First I strongly suggest get feedback on every challenge and refactor your code before you start a new challenge.

    HTML Structure

    • For decorative and avatar images, use empty alt text: alt=""
    • For the avatar image use the img tag in html. You don't need to use background on CSS.
    • header is for repeatable contents like nav items and page logo on the top of your website that repeats in every page. You need to use p here.
    • Your h1 is an a tag too. So inside the h1 wrap the text inide an a tag too. You don't need tabindex attribute here.

    CSS Best Practices

    • Start with a proper CSS reset (Andy Bell or Josh Comeau resets are recommended)
    • Use viewport height properly: This ensures content can expand beyond viewport height
    • Avoid fixed widths:
      • Remove width: 350px from .card
      • Use max-width for better text container adaptability
    • Use relative units:
      • rem for font-size and max-width instead of px
      • Learn more about this here
  • Moirand•60
    @Moirand
    Posted 5 months ago
    • I don't think put the avatar image in p::before is a best practice, but that's a pretty creative way.

    • Add these lines, so you don't have to define margin-bottom: 0px; in each element. Read about box-sizing: border-box; in this site. Also, these lines are common used in most of projects, so I recommend you to always add them.

    *,
    *::after,
    *::before {
        padding: 0px;
        margin: 0px;
        box-sizing: border-box;
    }
    

    Awesome👍

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.

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