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

Expenses-chart

@Khemmie-Ray

Desktop design screenshot for the Expenses chart component coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
2junior
View challenge

Design comparison


SolutionDesign

Solution retrospective


I appreciate feedbacks. Please how can I make the banner appear closer to each bar?

Community feedback

@Khemmie-Ray

Posted

Hello Yaika, I tried your suggestion but it took the banner farther away from the bars. Thanks for the suggestion.

0
Yaika Race 290

@YaikaRace

Posted

Hello Khemmie, congratulations on completing this challenge! The solution to your problem is simple, you have to add position: relative; to your .chart-container and it will look like this:

.chart-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    position: relative;
  }

This so that your .banner takes as reference of position to the container in which it is, after this you add a top: -48px; (this can be more or less distance depends on your taste) and it would be like this:

banner {
    background-color: hsl(25, 47%, 15%);
    color: white;
    margin-bottom: .7em;
    padding: .4em .2em;
    border-radius: 5px;
    text-align: center;
    position: absolute;
    top: -48px;
    display: none;
}

And so all the banners will appear near their corresponding bar.

This was my solution to your problem, I hope I helped you!

happy coding!

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