started by mobile-first workflow, using flex-box css n DOM-javascript
Design comparison
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
- @GioCuraPosted over 1 year ago
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 beingtransparent
. You can adjust the size of the arrow by changing it's width in theborder
attribute. You can adjust the position by changing thetop
andleft
values.Hope this helps!
Marked as helpful0 - @visualdennissPosted over 1 year ago
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 helpful0
Please log in to post a comment
Log in with GitHubJoin 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