jquery 实现简单的前端信息提示框

本文介绍了如何利用jQuery和CSS实现一个简单的前端信息提示框。首先,通过CSS定义了提示框的样式,接着展示了使用jQuery编写的代码来控制提示框的显示与隐藏,最后给出了实现效果的截图。
摘要由CSDN通过智能技术生成

1.css样式

<style>
  .ts-alert{
    position:fixed;
    top:50px;
    left:50%;
    z-index:999;
    white-space: normal;
    min-width: 200px;
    text-align: center;
    padding: 15px;
    padding-right: 15px;
    margin-bottom: 20px;
    border:1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.5);
    background-color: #DFF0D8;
    height: 30px;
    font-size: 14px;
  }

  .ts-alert-text{
    text-align:center;
    font-weight:bold;
    white-space: normal;
    line-height:24px;
  }

  button.close {
    -webkit-appearance: none;
    padding: 0;
    cursor: pointer;
    background: 0 0;
    border: 0;
    float: right;
    font-size: 21px;
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 1px 0 #fff;
    color:#222;
    margin-left:5px;
    line-height:26px;
  }

2.jquery代码

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值