Skip to content
  • Unlock Pro
  • Log in with GitHub
Profile
OverviewSolutions
30
Comments
1
Caleb Sim
@CodeLamp168

All comments

  • Angus Turnbull•70
    @echoturnbull
    Submitted over 2 years ago

    3 Column preview Card - HTML and CSS

    1
    Caleb Sim•410
    @CodeLamp168
    Posted over 2 years ago

    Container does not have a width given that's why the text is moving. However it does not center if you do.

    A tip: When you are making similar designs for each card, give them all the same class name. You can implement more than just one class to each. For class "item1" "item2" "item3". Instead write: "card item1" "card item2" "card item3" Now card and item are seperate classes for the element and can be good for organizing in css.

    So I use the class "card" for setting the width, height, and the padding for each card. You can set height to auto/height:auto and work through using margins for the text or just set a determined height. Usually recommend height:auto Then I use "item1" to design that specific card's color and image.

    Don't text-align:center on body. I usually do it on specific areas. But you can set the font-size and font-family there. check the style-guide thats given.

    Also its good practice to start designing by mobile first so that it can be responsive. Simply remove the display:flex on container and you have atleast a template for what the mobile design would be like. Then use ex: @media (min-width: 50em) { .container { display:flex; } for the desktop version. }

    This means when the screen hits 800px, the container will become display:flex. (You wont need to repeat any code just need to position the elements to row)

    You can look at my solution's html and css. However there are simpler solutions on github and they really do help make you understand the structure if you go through them.

    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