vue给单独页面添加背景颜色
vue 单独设置背景颜色的方法是在template下的子div上添加样式<template><div></div></template>给style添加一个scoped表示当前样式只给当前页面设置。将这个div属性设为:fixed,例如:<style scoped&
·
vue 单独设置背景颜色的方法是在template下的子div上添加样式
<template>
<div class="htmlBox">
<div></div>
</div>
</template>
给style添加一个scoped表示当前样式只给当前页面设置。
例如:
<style scoped>
.htmlBox >>> div {
background-color: #ffffff;
}
</style>
这里采用 >>> 的方式
即可改变当前页面的背景颜色
更多推荐
已为社区贡献4条内容
所有评论(0)