Trying to make a background image (jpg) fit a screen but all options don't seem to work...

The elements are created using innerHTML (I know, it's bad, I'm changing it once I figure this out) and currently the background has been applied to the root element (<div id="content"> in the html) Repo: https://github.com/callum-laing/restaurant
background: url("img/restaurant-front.jpg");
background-size: cover;
background: url("img/restaurant-front.jpg");
background-size: cover;
I've attached 2 images to showcase my issue. I'm trying to figure out how to make this less... zoomed in? but I'm not entirely sure how to do it.. I don't care if i can't have the picture show as it should be, aslong as some of the food is in there to give it some sort of nice looking effect.
GitHub
GitHub - callum-laing/restaurant
Contribute to callum-laing/restaurant development by creating an account on GitHub.
8 Replies
CDL
CDLOP•2y ago
New image here, but if I can somehow get the image to fit like this, it'd be perfect.. it seems to change based on how wide you have the screen.
croganm
croganm•2y ago
You can also set background position! I'd start at background-position: 50% 50% and play around with it until it's positioned how you want But yes, unfortunately the image size plays a major part. You need a landscape (or wide) image Portrait images will not work
CDL
CDLOP•2y ago
yeah fair enough.. i'll keep searching 😄 thanks
CDL
CDLOP•2y ago
ErickO
ErickO•2y ago
did you try using a 16:9 image instead of an iphone PepeLaugh
CDL
CDLOP•2y ago
haha
CDL
CDLOP•2y ago
CDL
CDLOP•2y ago
almost done. just have to figure out why there's a little gap at the top/bottom of the transparent background https://callum-laing.github.io/restaurant/ Winning.
Want results from more Discord servers?
Add your server