Skip to content
  • Unlock Pro
  • Log in with GitHub
Profile
OverviewSolutions
39
Comments
1
Demarcus
@Demarcus11

All comments

  • P
    edpau•470
    @edpau
    Submitted over 1 year ago

    Responsive blog preview card

    #bem
    2
    Demarcus•610
    @Demarcus11
    Posted over 1 year ago

    BEM is Block Element Modifier.

    A block is a standalone element in the UI such as a navigation, card, footer, etc.

    A element is part of a block and has no standalone meaning such as a navigation link, the title of a card, a link in a footer, etc.

    A modifier changes the appearance of an element such as the color of a button.

    In this case, the card is the only block, so everything inside the card should be prefixed with card__ because everything inside the card would have no meaning outside of the card such as the card heading, card genre, card image, etc.

    Your class names are almost perfect, the only issue is a small mistake on the card image class, it should be card__img instead of card-img because img is a element inside the card block:

    <img
        class="card__img"
        src="./assets/images/illustration-article.svg"
        alt=""
       />
    
    Marked as helpful
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

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