the helpful note says “Background images will be centered and have a default width of 590px”.
what is the height?
It seems to be random.
What size tricks it into loading the image as I created it?
My original image had been a square, so duh, of course that’s going to get cut off.
A colleagues User Card was displaying at 590x390, so I tried that size first.
590x390, surely that will work! nope
590x290? nope again
ok maybe it’s just that there’s black space on the L/R edges that’s confusing the magic, I’ll load an image with color that spans all the way to all the edges and set it to 590 wide
590 high? LOL nope, not gonna happen, cuts it off in the exact same way
I have tried several different shaped images (and several diff. images) and I can’t get any of them to play nice with the algorithm. Clearly normal humans just load an image and it’s all good. Or maybe they don’t care how it’s being cut off because it’s a user card for cripes sake, that is muted behind the important words, why am I arguing with technology?
I searched in here and can’t find it, please please please tell me:
What’s the magic number?
is it a size? a ratio? must I sacrifice a latte to the Tea Gods first?
thank you for your assistance in my ultra~trivial pursuit of the pretty
Notice how the height of the card increased by 80px even though the content is still the same? Well that happens because we add some margins to the content of cards with backgrounds to create this effect
That results in the card height increasing by an additional ~ 50px.
The point I’m trying to make is that there is no perfect height since the card will expand to fit the content.
This is why we use CSS to add the background instead of adding the image as an actual element. This allows us to make the background responsive. The way it’s displayed depends on the height of the card. Here’s an exaggerated example
Again, this is an exaggerated example and user-cards are never allowed to be that big.
If you noticed, for all the examples above, the card width was always 580px. This is intentional. However, that’s only the case on desktop. Mobile is a different case. The width of the card is based on the the size of the screen.
As we found out above, the user card can be either rectangular or square depending on the device you view it on. Uploading a square image is not really an issue - again because we use CSS to set its size.