I am looking to create a fluid background that stretches widthwise, while adjusting its height based on the content. If the content is smaller, I want the background to be truncated. However, if there is a lot of information, I would like the background to smoothly transition to black. Here’s what I have so far:
body {
margin: 0; padding: 0;
height:1000px;
background: url(images/background.jpg) no-repeat #000;
width: 100%;
background-position: left top;
background-size: 100% 1000px;
}
The issue is that this approach has a fixed size. I attempted changing the height
to auto, but the background did not display at all.
Is it possible to achieve what I’m envisioning?
Thank you.