Skip to content
  • Learning paths
  • Challenges
  • Solutions
  • Articles
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted over 4 years ago

Article preview component with HTML , CSS , JS

Abhik•4,820
@abhik-b
A solution to the Article preview component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


I have used javascript for some animations however I guess my code can be improved ! Any feedback will be appreciated 😇

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • ApplePieGiraffe•30,525
    @ApplePieGiraffe
    Posted over 4 years ago

    Hey, Abhik Bhattacharya! 👋

    Nice work on yet another challenge! 😆

    A few tips I might suggest are,

    • Adding cursor: pointer to the social media popup button.
    • Adding a max-width to the card component to prevent it from becoming too wide on extra-large screens.
    • Adding object-fit: cover to the image so that it is cropped and does not distort when the page is resized.
    • Adding a little bit more space around the text content of the card component in the mobile layout to give the content some room.

    Keep coding (and happy coding, too)! 😁

  • Aleksandr Aksenov•750
    @axevldk
    Posted over 4 years ago

    Hi, Abhik Bhattacharya ~

    I have studied your work here. Great work, especially I like your animation on social icons for mobile. 👍 Here are really tiny opinions for your work.

    Under 375px, responsiveness goes weird. Especially on iPhone5 size. It could be a flaw in your wonderful work. And there are 2 empty srcset attributes on your markup. That's all.

    Happy coding ~ ✨

  • Guy Ezra•615
    @ezraguy
    Posted over 4 years ago

    Hey @abhik-b, great job!

    I have 2 suggestions:

    1. like @axevldk said around 300px width the text in the card starts to overflow.

    2. In the 1023px breakpoint I would make the card's width around 55% percent because, in my opinion, 80% percent looks a bit stretched and I would add min-width to the card.

    @media screen and (max-width: 1023px)
    article {
        grid-template-areas:
            "image image"
            "details details";
        grid-template-columns: 1fr;
        grid-template-rows: 200px auto;
        height: 70%;
        width: 55%;
        min-width: 300px;
    

    other than that it's great!

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

Frontend Mentor for Teams

Frontend Mentor for Teams helps companies and schools onboard and train developers through project-based learning. Our industry-standard projects give developers hands-on experience tackling real coding problems, helping them master their craft.

If you work in a company or are a student in a coding school, feel free to share Frontend Mentor for Teams with your manager or instructor, as they may use it to help with your coding education.

Learn more

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