问题:一个1920*900的大图,在1024*768的分辨率只能显示一部分,希望仍居中显示
解决方案CSS:
width: 100%;
background-position: 50% 50%;
示例code:
<style>
body {
background-repeat: no-repeat;
width: 100%;
background-position-x: 50%;
background-position-y: 118px;
background-image:url(@Url.Image("/XXX/XX.jpg"));
}
.book {
margin: 0 auto;
width: 960px;
height: 700px;
position: relative;
}
</style>
<div class="book"></div>