【css】4.background-image背景图片设置
background-image背景图片设置
·
.home {
background-image: url(../assets/back.jpg);
background-size: 100% 100%;
/*按比例缩放*/
background-repeat: no-repeat;
/*还有repeat-x,y等*/
width: 100%;
height: calc(100vh - 0px);
position: relative;
}
.content {
width: 715px;
height: 376px;
border-radius: 3px;
background-color: #ebecef;
position: absolute;
right: 8%;
top: 24%;
}
<template>
<div class="home">
<div class="content">
</div>
</div>
</template>
<style lang="scss" scoped>
@import "./object.scss";
</style>
更多推荐
已为社区贡献7条内容
所有评论(0)