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

Order Summary Component with HTML and CSS

hannah 40

@hannah-mazri

Desktop design screenshot for the Order summary component coding challenge

This is a solution for...

  • HTML
  • CSS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


Is there any way to make the background image static when the screen is resized?

Community feedback

@beslerpatryk

Posted

I agree with @Fluffy Kas about the separate stylesheet for CSS. However, I believe that removing background-position is not the answer to your problem.

From MDN-Docs: "background-position sets the initial position for each background image"

If you want the background to be static you need to get rid of the background-size property which sets the size of the element's background image.

Notice that you specified in your media query: background-size: contain;

If you get rid of it the background will remain static (the size of it won't change with the size of the window). Having it set the property to contain is actually the right thing to do though, since it makes sure that the SVG background always covers all the background.

Hope you find that helpful. Cheers!

Marked as helpful

2
dewslyse 3,025

@dewslyse

Posted

Also, remember there is a separate background image for mobile devices.

Marked as helpful

1
P
Fluffy Kas 7,735

@FluffyKas

Posted

Hiya, good looking solution!

Remove the background-position and it will stay static. Also, I'd suggest linking a separate stylesheet for your css, it's not really good practice having it in your html file.

Marked as helpful

1

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