Design comparison
SolutionDesign
Solution retrospective
Any addition will be much appreciated.
Community feedback
- @LeskimPosted over 1 year ago
You can add the hover on the bars by adding a p tag with the amount while mapping out the data
<div class=${ bar.day === dayName ? "activeday" : "bar"} style="height:${bar.amount * 3}px"> </div> <p class="amount">$${bar.amount}</p> <p class="day"> ${bar.day} </p>
then setting it to display when the bars are hovered using css
.bar_items { position: relative; } .amount { position: absolute; top: -2.3rem; background-color: var(--Darkbrown); color: var(--Verypaleorange); padding: 0.5rem; font-size: 0.7rem; border-radius: 3px; display: none; } .bar:hover + .amount { display: block; }
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