Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

started by mobile-first workflow, using flex-box css n DOM-javascript

@PhilipeeX

Desktop design screenshot for the Article preview component coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


I had trouble trying to implement a 'modal' that would pop up when the 'share' button was clicked. I am unsure how to add the arrow below the 'modal' to make it look more stylish.

Community feedback

Gio Cura 650

@GioCura

Posted

Hi! 👋 To add the little arrow under your modal/tooltip, you have to add a ::before or ::after pseudo-element to your "compartilhamento" div.

Go, to your style.css and write something like this:

compartilhamento::after {
    content: "";
    border: 1.2rem solid;
    border-color: hsl(217, 19%, 35%) transparent transparent transparent;
    position: absolute;
    top: 100%;
    left: 50%;
}

Here, the arrow is made by setting border-color to have only one side with a color, and the rest being transparent. You can adjust the size of the arrow by changing it's width in the border attribute. You can adjust the position by changing the top and left values.

Hope this helps!

Marked as helpful

0
P
visualdennis 8,375

@visualdenniss

Posted

Hey there,

nice job with the challenge. A small observation: your arrow icon seems to look like ellipse rather than circle. To fix that you can simply change .5rem padding to padding: 0.5rem 0.75rem;

To add that triangle below the modal, you can use something like

.modal::before { content: ''; width: 15px; height: 15px; background: hsl(217, 19%, 35%); position: absolute; bottom: -7.5px; left: 50%; transform: translateX(-50%) rotate(45deg); }

Hope you find this feedback helpful!

Marked as helpful

0

Please log in to post a comment

Log in with GitHub
Discord logo

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