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

Pure CSS solution with hover/active effects

Emmilie Estabillo•5,600
@emestabillo
A solution to the Article preview component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


I tried to apply border-radius: 1.5rem to the main tag but it didn't work. Had to individually target every corner. Why is that? Any kind of feedback is welcome.

Code
Select a file

Please log in to post a comment

Log in with GitHub

Community feedback

  • Account deletedPosted about 5 years ago

    Hi.

    The issue is because children elements are overflowing so their borders are shown.

    The solution is to remove all the border-radius that you have and leave it only in the main tag + you must use the overflow: hidden property, so children's borders aren't displayed

    main {
        ...
        border-radius: 1.5rem;
        overflow: hidden;
    }
    
  • Shashi Lo•1,345
    @shashilo
    Posted about 5 years ago

    Emmilie, this looks exactly like the design. I can't even tell the difference! Great job! I did find a few areas of improvement besides the border-radius.

    • The hover states should transition together. Currently, on desktop, when you hover on the CTA, the shared bubble transitions a little later. Onmouseleave, the button transitions quickly and before the shared button. There's no cohesion right now.
    • Missing content box-shadow.
    • The CTA doesn't work well on mobile. Either use an input button and make it pure CSS or use Javascript to toggle the states as the mobile user clicks on the CTA.
  • Roman Filenko•3,335
    @rfilenko
    Posted about 5 years ago

    Hey, generally setting border-radius and overflow:hidden on parent container works, but for popup you probably need to use js, coz on mobile hover wouldn't work. Nice solution though

    Cheers, Roman

  • P
    Robert McGovern•1,075
    @tarasis
    Posted almost 5 years ago

    Near pixel perfect, love it Em!

    Main thing I see behaviour wise is that the share icon often doesn’t return to the base Color when dismissed. It stays darker grey with white. (On my iPad, where I do most of my browsing)

    Imgur

    (Aside I wish your current mentor score was 1701 rather than 1710 🖖)

  • Jen•1,230
    @En-Jen
    Posted almost 5 years ago

    Hi Emmillie, really nice solution!! Basically pixel perfect 👌 Really nice, organized, readable code too. I'll have to study more of your projects to learn some things from you! I just have one super minor suggestion for something you could fix. It looks like on a small mobile screen size like an iPhone 5, the attribution overlaps with the content on the page.

  • Alice Souza•0
    @alicepsz98
    Posted about 5 years ago

    Tente com px, em vez de rem.

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

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

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

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

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