Copy link to clipboard
Copied
I've been toying with full-size background images, alternating between background-size: cover and contain. After some testing, I'm wondering if the behavior I'm looking for is even doable. Thought I'd ask here.
The image is of a standing silhouette.
The behavior I'm looking for is :
What is the simplest and most code-efficient way to obtain this result?
Thanks!
Found it! Or close enough behavior that my original plans for the layout don't need to be trashed.
Here it is, in case anyone wants to try anything similar :
div#bg {
background-image: url(/images/bg-main.png);
height: 100%;
width: 50%;
background-size: cover;
background-position: right;
background-repeat: no-repeat;
}
(with the appropriate adjustments to html+body to remove margins and stuff)
Sorry for wasting everyone's time with this one. For whatever reason, I kept trying to tr
...Copy link to clipboard
Copied
Probably best done with two separate images and different media queries for when things begin to fall apart
Copy link to clipboard
Copied
Post the actual image and let's have a play with it.
Copy link to clipboard
Copied
Found it! Or close enough behavior that my original plans for the layout don't need to be trashed.
Here it is, in case anyone wants to try anything similar :
div#bg {
background-image: url(/images/bg-main.png);
height: 100%;
width: 50%;
background-size: cover;
background-position: right;
background-repeat: no-repeat;
}
(with the appropriate adjustments to html+body to remove margins and stuff)
Sorry for wasting everyone's time with this one. For whatever reason, I kept trying to trick my way around left-justifying the image when it should've been right-justified the whole time.