vue 设置固定背景图片

这篇博客展示了如何使用HTML和CSS进行网页布局设计。主要内容包括一个名为'helloWorld'的div元素,背景设置为固定且不可重复的图片,以及一个内容区域。内容区域采用flex布局,确保内容居中显示。此外,还涉及了CSS的溢出处理和定位属性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

<template>

  <div id="helloWorld">
    <div class="content">
           hello World
    </div>
</div>
</template>

#helloWorld{
  background-image:url('../../assets/uni_backgroud_pic.png');
  background-repeat: no-repeat;
/*  z-index:1; */
  position: fixed;
  width: 100%;
  height: 100vh;
  overflow: auto;

}
.content{
  width: 100%;
  overflow: auto;
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;
  /* z-index:2; */
}

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值