微信扫一扫打赏支持

amazeui学习笔记--css(常用组件1)--小徽章Badge

amazeui学习笔记--css(常用组件1)--小徽章Badge

一、总结

1、am-badge:添加am-badge来声明小徽章对象 <span class="am-badge am-badge-primary">2</span>

2、badge位置:badge可以放在span或者a标签中  <a class="am-badge am-badge-primary">Free</a>

3、圆角样式或者椭圆样式:am-radius 和 am-round

4、小徽章大小:小徽章大小可以通过改变里面字体的大小来实现:<span class="am-badge am-badge-secondary am-text-sm">small</span>

 

二、小徽章Badge

Badge


添加 .am-badge class 到 <div> 或者 <span> 元素。

默认样式

 Copy
Allmobilize
Free Secondary Success Warning Danger
<span class="am-badge">1</span>
<span class="am-badge am-badge-primary">2</span>
<span class="am-badge am-badge-secondary">3</span>
<span class="am-badge am-badge-success">4</span>
<span class="am-badge am-badge-warning">5</span>
<span class="am-badge am-badge-danger">6</span>
<span class="am-badge am-badge-success">Allmobilize</span>
<br>
<a class="am-badge am-badge-primary">Free</a>
<a class="am-badge am-badge-secondary">Secondary</a>
<a class="am-badge am-badge-success">Success</a>
<a class="am-badge am-badge-warning">Warning</a>
<a class="am-badge am-badge-danger">Danger</a>

圆角样式

在默认样式的基础上添加 .am-radius class。

 Copy
Allmobilize
Free Secondary Success Warning Danger
<span class="am-badge am-radius">1</span>
<span class="am-badge am-badge-primary am-radius">2</span>
<span class="am-badge am-badge-secondary am-radius">3</span>
<span class="am-badge am-badge-success am-radius">4</span>
<span class="am-badge am-badge-warning am-radius">5</span>
<span class="am-badge am-badge-danger am-radius">6</span>
<span class="am-badge am-badge-success am-radius">Allmobilize</span>
<br>
<a class="am-badge am-badge-primary am-radius">Free</a>
<a class="am-badge am-badge-secondary am-radius">Secondary</a>
<a class="am-badge am-badge-success am-radius">Success</a>
<a class="am-badge am-badge-warning am-radius">Warning</a>
<a class="am-badge am-badge-danger am-radius">Danger</a>

椭圆样式

在默认样式的基础上添加 .am-round class。

 Copy
Allmobilize
Free Secondary Success Warning Danger
<span class="am-badge am-round">1</span>
<span class="am-badge am-badge-primary am-round">2</span>
<span class="am-badge am-badge-secondary am-round">3</span>
<span class="am-badge am-badge-success am-round">4</span>
<span class="am-badge am-badge-warning am-round">5</span>
<span class="am-badge am-badge-danger am-round">6</span>
<span class="am-badge am-badge-success am-round">Allmobilize</span>
<br>
<a class="am-badge am-badge-primary am-round">Free</a>
<a class="am-badge am-badge-secondary am-round">Secondary</a>
<a class="am-badge am-badge-success am-round">Success</a>
<a class="am-badge am-badge-warning am-round">Warning</a>
<a class="am-badge am-badge-danger am-round">Danger</a>

大小

结合辅助类中的字号 class,改变徽章大小。

 Copy
default small normal large x large
<span class="am-badge am-badge-primary">default</span>
<span class="am-badge am-badge-secondary am-text-sm">small</span>
<span class="am-badge am-badge-success am-text-default">normal</span>
<span class="am-badge am-badge-warning am-text-lg">large</span>
<span class="am-badge am-badge-danger am-text-xl">x large</span>

 

posted @ 2018-05-08 22:54  范仁义  阅读(358)  评论(0编辑  收藏  举报