The
background-size property in CSS is one of the most useful — and most complex — of the background properties. There are many variations and different syntaxes you can use for this property, all of which have different use cases.
I have a photo type (not landscape) background image with 979px Width by 1200px Height. I would like to set it to float left and show 100% full image height fixed without the need to scroll up/down (regardless of content length).
This is my CSS code but not working.
img , media {
max-width: 100%;
}
body
{
background-color: white;
background-image: url( '.. /images/bg-image. jpg ');
background-size: auto 100%;
background-repeat: no-repea t;
background-position: left top;
}
You can do it with the code you have. You need to ensure that the
html and body are set to 100% height thoughhtml , body {
height: 100%;
}
body
{
background-color: white;
background-image: url('http://www.canvaz.com/portrait/charcoal-1.jpg');
background-size: auto 100%;
background-repeat: no-repeat;
background-position: left top;
}
