Skip to content

Background image doesn't appear inside circular progress bar #732

Answered by Kheirah
donacrisante asked this question in Web
Discussion options

You must be logged in to vote

Some things were right, some weren't. Let's start with the things that were right. The styled components for the background image can stay as it is:

const StyledBackground = styled.div`
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url(/SustainableCity.jpg);
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  z-index: -1;
`; 

Actually that's about it. Now to the things that need adjusting. For implementing the ciruclar progress bar and the StyledBackground you write:

<StyledCircularProgressbar
    value={co2Emission}
    maxValue={2000}
    text={`${co2Emission.toFixed(2)} kg`}
/>
<StyledBackground />

A…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Kheirah
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Web
Labels
None yet
2 participants