【前端开发日常记录】002.设计一个固定在页面上的提示框

在这里插入图片描述

功能及缺陷描述

  • 贴在页面右侧
  • 缺陷提醒:zIndex、不支持点击隐藏(以后优化,比如点击折叠成一个问号贴在页面旁边避免占位置,部分强迫症要气死)、形状做的尽力了

部分技术点总结

在HTML中实现两个div并排显示

  • (1)设置为行内样式,display:inline-block

  • (2)设置float浮动

  • (3)设置position定位属性为absolute

border-radius:从左上顺时针切割
antd的Affix组件可实现固定

代码

<Affix 
 offsetTop={400} 
  // onChange={(affixed) => console.log(affixed) }
  onClick={() => window.open("xxx")}
  style={{ width:200, position: 'absolute', top: 250, right: 0, zIndex: 100}}>
  <div className={styles["affix-container"]}>
    <div style={{display:"inline-block", marginLeft:10, fontSize:70, fontWeight:"bold", color:"#6782ff"}}>
      ?
    </div>
    <div style={{display:"inline-block", marginLeft:8, fontSize:12, fontWeight:"bold"}}> 
      <p style={{marginBottom:3}}>遇到问题了吗?</p>
      <p style={{marginBottom:3}}>不知道该如何填写?</p>
      <p style={{marginBottom:3}}>{'<<<'}请点击</p>
    </div>  
  </div> 
</Affix>
.affix-container {
  // border: 1px solid #6782ff;
  border-radius: 20px 65px 65px 20px;
  background-color: #f0f5ff;
}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值