div背景css样式笔记

<style type="text/css">
.div1 {
width: 1024px;
height: 100%;
margin: 0 auto;
/*background-size: cover;*/
background-image: url("${basePath}/images/t4.jpg");
/*背景图像将仅显示一次,不重复*/
background-repeat: no-repeat;
/*!*图片在容器中间位置*!*/
/*background-position: center;*/
/*图片不会随着容器滚动而滚动*/
background-attachment:fixed;
/*
参数:
contain表示把图像图像扩展至最大尺寸,以使其宽度和高度完全自动适应内容区域,可能不填充满;
cover表示把背景图像扩展至足够大,以使背景图像完全覆盖背景区域,背景图像的某些部分也许无法显示在背景定位区域中。
*/
background-size: cover;

}
.div2{
width: 1024px;
background-color: rgba(110, 167, 194, 0.42);
position: fixed;
top:0;
}

.iframe{
width:100%;
height:100%;
display: none;
}

</style>

猜你喜欢

转载自www.cnblogs.com/c2g5201314/p/11689492.html