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

with the help of HTML CSS and JS (help with background- image)

#sass/scss
Daniel• 100

@danM51

Desktop design screenshot for the Pricing component with toggle coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
2junior
View challenge

Design comparison


SolutionDesign

Solution retrospective


"Stick to it, it does get better", another project completed and happy to how far I have come... any feedback is always welcome!

oh one more thing, I could not figure out how to get the background images working, I guess my question is <how do you separate the top and bottom background images via Css or is it all applied in html first?>

thank you in advance :-)

Community feedback

Nakoya Wilson• 1,530

@nakoyawilson

Posted

You can add more than one background-image by separating the url sources with a comma and then you can do the same with background position. The code would look like:

body {
  background-image: url(./images/bg-top.svg), url(./images/bg-bottom.svg);
  background-repeat: no-repeat, no-repeat;
  background-position: right top, left bottom;
}

Also in your media query you have the wrong path for your background image. You have background-image: url(/src/images/bg-top.svg); instead of background-image: url(./images/bg-top.svg);

Marked as helpful

2

Daniel• 100

@danM51

Posted

@nakoyawilson, I am flabbergasted, thanks a million!

0
Nakoya Wilson• 1,530

@nakoyawilson

Posted

@danM51 You're welcome!

0
Stefan• 620

@stfnpczk

Posted

@nakoyawilson @danM51 one little side note for the background-repeat property, you only need to set no-repeat once, it gets applied for both svgs. :)

0
Nakoya Wilson• 1,530

@nakoyawilson

Posted

@stfnpczk Good to know. Thanks!

0
Coder Aishya• 140

@Aishwarya-Dhuri

Posted

You can also use pseudo elements on container for background images like &:before for top background image and &:after for bottom one

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