Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

background-size - height precedence over width?

Status
Not open for further replies.

ralphonzo

Programmer
Apr 9, 2003
228
GB
Is there any way to make the height of background-size take precedence over the width? If you resize the browser window at: widthwise, you'll see the image leave the dock at the foot of the screen and lose none of its constraints; whereas if its minimised heightwise, elements of the image disappear below the menu bar, as the width is maintained percentagewise.

Code:
background-image: url(images/bg-2.jpg);
-webkit-background-size: 100%;
-moz-background-size: 100%;
-o-background-size: 100%;
background-size: 100%;

How can the width be "ignored" here?
 
Code:
background-size: auto 100%;
This should work, however, I believe it fails in your code, because you don't really have any elements that are part of normal document flow inside your body. Heights are much more volatile than widths in HTML and your body is very small in height (because of lack of statically positioned content), while your width is still the same as viewport (because this is how widths work).

[small]Do something about world cancer today: Comprehensive cancer control information at PACT[/small]
 
Thanks for the reply, but I'm afraid your concerns were founded and that doesn't give the desired affect. I think the issue is more with the cruddy images we were supplied!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top