我有一张照片类型(非横向)的背景图片,宽度为979像素,高度为1200像素。我想将其设置为左浮动,并显示100%的全图高度固定,无需上下滚动(无论内容长度如何)。
这是我的CSS代码,但它没有起作用:
img, media {
max-width: 100%;
}
body {
background-color: white;
background-image: url('../images/bg-image.jpg');
background-size: auto 100%;
background-repeat: no-repeat;
background-position: left top;
}