The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS .png isn't filling box, please help me understand why Reply To: .png isn't filling box, please help me understand why


As to the why this is happening; there are a couple of things.

(1) The site you reference as how it SHOULD look is just loading an image via the IMG tag. Nothing fancy going on; the image loads and is the width / height that it is. Your new site is loading a background into a container that has CSS applied to it. Very different beasts.

(2) The CSS you’re using has background-size: contain !important which is the likely culprit. What this translates to is “Fit the background into this container; make sure we see 100% of the background so downsize/upsize as needed.”

From what you’re describing – what you want is background-size: cover which is more “Fill this entire container with the background image regardless if by doing so some of the image is hidden.”