首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Bootstrap开源组件:徽章的文档和示例

Bootstrap开源组件:徽章的文档和示例

原创
作者头像
小颖club
发布2022-04-12 12:08:57
4430
发布2022-04-12 12:08:57
举报
文章被收录于专栏:建站技术博客建站技术博客

Bootstrap开源组件:徽章的文档和示例。使用世界上最流行的前端开源工具包 Bootstrap 快速设计和定制响应式移动优先网站,具有 Sass 变量和混合、响应式网格系统、广泛的预构建组件和强大的 JavaScript 插件。

但是它的很多组件都是继承在整体JavaScript中,今天分离的徽章的文档和示例,先看样式:

完整代码如下:

<div class="shbd-example">
    <button type="button" class="shbtn shbtn-primary">
      Profile <span class="shbadge shbadge-light">9</span>
     
    </button>
    </div>
<style>
    .shbtn {
    display: inline-block;
    font-weight: 400;
    color: #212529;
    text-align: center;
    vertical-align: middle;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}
.shbadge {
    display: inline-block;
    padding: 0.25em 0.4em;
    font-size: 75%;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
    transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}
.shbadge-light {
    color: #212529;
    background-color: #f8f9fa;
}
.shbtn .shbadge {
    position: relative;
    top: -1px;
}
.shbd-example>.shbtn, .shbd-example>.shbtn-group {
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}
.shbd-example {
    padding: 1.5rem;
    margin-right: 0;
    margin-left: 0;
    border-width: 0.2rem;
}
.shbtn-primary {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}
</style>

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档