[personal profile] kittyrefuge posting in [community profile] style_system
I have been trying to find out the answer for the last (OMG) 5 hours...Now I'm hoping somebody can help me out from this situation.

The Base Style I'm using is Blanket.



#title span { display: none; }
#title {
position: center;
width: 500px;
height: 250px;
margin-left: auto;
margin-right: auto;
margin-bottom: 0px;
background-image: url("https://ic.pics.livejournal.com/kittyrefuge/12716922/407688/407688_original.jpg");
background-repeat: no-repeat;
}

But the result is :

header

And when I check it on my phone :
header on my iPhone
My header pic goes out of the frame...

Somebody, please?

Date: 2018-07-28 10:54 pm (UTC)
syntheid: [Elementary] Watson drinking tea looking contemplative (Default)
From: [personal profile] syntheid
Well, this is basically happening because you're setting the background image on the title instead of just inserting an image, so you have to set a defined width on that container (500px, looks like), to make the whole image display. You have a couple options I can see, that are all sort of compromises, so maybe try it and see what you can live with, but.

If you change the styling on #title to

#title {
  width: 100%;
  resize: both;
  height: 250px;
  background-image: url(https://ic.pics.livejournal.com/kittyrefuge/12716922/407688/407688_original.jpg);
  background-repeat: no-repeat;
  background-size: contain;
}


that will keep your image contained inside the div, but does result in different white space around the image depending on what size it's at.

You could use background-size: cover; instead of background-size: contain;, and then it'll try to always fill up the box, but depending on the resolution of the device you're viewing from, it will crop the image differently.

And you could try to fiddle with the @media query breakpoints to force the container to stay wider even on small resolutions/overwrite the container width always, but you'll still have it scroll off the side. And this is more involved so I don't really have a single solution upfront, but from a bit of fiddling you could say do a min-width: 585px; on the #header or change @media only screen and (min-width: 40em) to like @media only screen and (min-width: 50em) or something and set a larger width there or something.

Hope that helps?
Edited Date: 2018-07-28 10:56 pm (UTC)

Profile

Dreamwidth style system discussion

October 2025

S M T W T F S
   1 234
567891011
12131415161718
19202122232425
262728293031 

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Jan. 11th, 2026 04:46 am
Powered by Dreamwidth Studios