首页 > 其他分享 >前端学习-UI框架学习-Bootstrap5-008-信息提示框

前端学习-UI框架学习-Bootstrap5-008-信息提示框

时间:2024-03-29 10:36:00浏览次数:35  
标签:信息 alert 添加 UI 类来 Bootstrap5 提示框 链接

菜鸟教程链接

提示框-基础颜色

提示框可以使用 .alert 类, 后面加上 .alert-success, .alert-info, .alert-warning, .alert-danger, .alert-primary, .alert-secondary, .alert-light 或 .alert-dark 类来实现:

提示框添加链接

提示框中在链接的标签上添加 alert-link 类来设置匹配提示框颜色的链接:

关闭提示框

我们可以在提示框中的 div 中添加 .alert-dismissible 类,然后在关闭按钮的链接上添加 class="btn-close" 和 data-bs-dismiss="alert" 类来设置提示框的关闭操作。

提示框动画

.fade 和 .show 类用于设置提示框在关闭时的淡出和淡入效果:

<template>

  <div class="container mt-3">
    <h2>提示框</h2>
    <p>提示框可以使用 .alert 类, 后面加上指定特定意义的颜色类来实现:</p>
    <div class="alert alert-success alert-dismissible fade show">
      <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
      <strong>成功!</strong> 指定操作成功提示信息。
    </div>
    <div class="alert alert-info alert-dismissible fade show">
      <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
      <strong>信息!</strong> 你应该认真阅读 <a href="#" class="alert-link">这条信息</a>
    </div>
    <div class="alert alert-warning">
      <strong>警告!</strong> 你应该认真阅读 <a href="#" class="alert-link">这条信息</a>
    </div>
    <div class="alert alert-danger">
      <strong>错误!</strong> 失败的操作
    </div>
    <div class="alert alert-primary alert-dismissible fade show">
      <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
     <strong>首选!</strong> 这是一个重要的操作信息。
    </div>
    <div class="alert alert-secondary">
     <strong>次要的!</strong> 显示一些不重要的信息。
    </div>
    <div class="alert alert-dark">
     <strong>深灰色!</strong> 深灰色提示框。
    </div>
    <div class="alert alert-light">
      <strong>浅灰色!</strong>浅灰色提示框。
    </div>
  </div>

</template>

标签:信息,alert,添加,UI,类来,Bootstrap5,提示框,链接
From: https://www.cnblogs.com/ayubene/p/18103198

相关文章

  • 前端学习-UI框架学习-Bootstrap5-007-图像形状
    菜鸟教程链接圆角效果rounded<imgsrc="./img/537.jpeg"class="rounded"alt="圆角效果"height="236">椭圆rounded-circle<imgsrc="./img/537.jpeg"class="rounded-circle"alt="拖延"heig......
  • 关于使用IconData时flutter build apk 打包报错Target aot_android_asset_bundle fail
    flutter项目中引入了iconfont.ttf之后,调试时正常,打包就报错。 网上有的说法是:使用了iconfont.ttf里面不存在的icon,但是我使用的都是在iconfont.tt文件中的icon。 我的情况是使用了switch  case给IconData的codePoint动态赋值,下面这种情况就是打包报错的 解决办法是......
  • element-ui表单校验:有值却不通过 el-form validate
    解决:新增/编辑赋值的时候,所有明明有值校验不通过的属性使用$set赋值this.$set(this.form,"属性名","");//新增置空this.$set(this.form,"属性名",row.shuxing);//编辑赋值 ......
  • 前端学习-UI框架学习-Bootstrap5-006-表格
    菜鸟教程链接基础表格<template><divclass="containermt-3"><h2>基础表格</h2><p>.table类来设置基础表格的样式:</p><tableclass="table"><thead><tr>&l......
  • 2024.03.28【UI设计】新拟态风格设计
    新拟态风格就是类似于给图形图案制作出3D的凸出或者凹进效果的风格这个风格的设计需要使用到即时设计软件的蒙版(与ai不同,ai的蒙版仅有透明度蒙版,无轮廓蒙版)新拟态风格的实现主要是通过三个效果:(1)一个相对浅色高斯模糊效果元素、(2)一个相对深色的无效果元素、(3)一个正常颜色的高......
  • 前端学习-UI框架学习-Bootstrap5-005-颜色
    菜鸟教程学习链接字体颜色Bootstrap5提供了一些有代表意义的颜色类:.text-muted,.text-primary,.text-success,.text-info,.text-warning,.text-danger,.text-secondary,.text-white,.text-dark,.text-body(默认颜色,为黑色)and.text-light:可以设置文本颜色透明度......
  • BLE --- UUID 介绍
    UUID简介UUID是一种普遍唯一的标识符,期望在所有空间和所有时间内都是唯一的(更准确地说,独立生成的UUID相同的概率可以忽略不计)。可以以分布式方式独立创建uuid。不需要分配uid的中央注册中心。UUID是128位的值。为了减少存储和传输128位UUID值的负担,预先分配了一系列UUID值,以便......
  • [转][C#] Guid 一些常用方法
    在SQLServer里面,定义GUID类型的字段是:uniqueidentifier生成一个全是0组成的GUID的写法是:cast(cast(0asbinary)asuniqueidentifier)生成一个随机的GUID的写法是:SELECTNEWID()在C#里面,生成Guid的方法是:varnewid=Guid.NewGuid().ToString("d");......
  • 前端学习-UI框架学习-Bootstrap5-004-文字排版
    菜鸟教程链接Bootstrap5默认设置Bootstrap5默认的font-size为16px,line-height为1.5默认的font-family为"HelveticaNeue",Helvetica,Arial,sans-serif此外,所有的元素margin-top:0、margin-bottom:1rem(16px)h1-h6<template><divclass="con......
  • elementUI表单表头增加筛选
    1、增加过滤条件 2、定义数据,必须包含text以及value 3、使筛选的id与行内元素id一直进行筛选 4、对下拉icon大小更改 ......