CSS固定图片或元素在屏幕右下角

固定图片:

body{

background-image:url(http://coding.imweb.io/img/project/blog/bg.jpg);
background-position:right bottom;
background-repeat :no-repeat;
background-attachment:fixed;
background-color: white;

}

固定元素:

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
element ui 右下角提示可以通过创建一个锚点盒子,并在盒子中添加四个圆角标按钮来实现。可以使用 element-ui 的圆角标配合 el-icon 创建基础按钮。然后,通过添加悬浮事件扩展特效来实现右下角提示的效果。锚点跳转可以通过使用dom元素定位来实现。具体的实现流程如下: 1. 创建一个锚点盒子,并在盒子中添加四个圆角标按钮。 2. 将锚点盒子固定屏幕右下角,并提高层保证能不被其他元素所覆盖。 3. 将按钮设置为块级元素,使其上下排列,并去掉按钮的外边距,同时设置合适的间隔距离。 4. 为按钮添加点击的锚点跳转事件。 5. 将锚点按钮改为数据驱动的动态渲染。 代码如下: ```html <div class="anchor-tool"> <el-button @click="goAnchor(target)" icon="el-icon-top" circle></el-button> <el-button @click="goAnchor(target)" icon="el-icon-goods" circle></el-button> <el-button @click="goAnchor(target)" icon="el-icon-discount" circle></el-button> <el-button @click="goAnchor(target)" icon="el-icon-present" circle></el-button> </div> ``` ```css .anchor-tool { position: fixed; padding-left: 16px; z-index: 2; bottom: 10vh; } .anchor-tool > * { display: block; margin: 0 !important; margin-bottom: 8px !important; } ``` ```javascript export default { //... data() { //... anchorBtns: [ { target: '#top', content: '<el-icon class="el-icon-top"></el-icon>', hint: '<div>顶</div>' }, { target: '#goods', content: '<el-icon class="el-icon-goods"></el-icon>', hint: '<div>商</div>' }, { target: '#discount', content: '<el-icon class="el-icon-discount"></el-icon>', hint: '<div>抢</div>' }, { target: '#present', content: '<el-icon class="el-icon-present"></el-icon>', hint: '<div>租</div>' } ] } } ```

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值