进度条可以显示用户任务的完成过程。
创新互联公司-专业网站定制、快速模板网站建设、高性价比南郑网站开发、企业建站全套包干低至880元,成熟完善的模板库,直接使用。一站式南郑网站制作公司更省心,省钱,快速模板网站建设找我们,业务覆盖南郑地区。费用合理售后完善,十载实体公司更值得信赖。
创建一个基本的进度条的步骤如下:
<
div
class
=
"
progress
"
>
<
div
class
=
"
progress-bar
"
style
=
"
width:70%
"
>
div
>
div
>
尝试一下 »
进度条高度默认为 16px。我们可以使用 CSS 的 height
属性来修改他:
<
div
class
=
"
progress
"
style
=
"
height:20px;
"
>
<
div
class
=
"
progress-bar
"
style
=
"
width:40%;
"
>
div
>
div
>
尝试一下 »
可以在进度条内添加文本,如进度的百分比:
<
div
class
=
"
progress
"
>
<
div
class
=
"
progress-bar
"
style
=
"
width:70%
"
>
70%
div
>
div
>
尝试一下 »
默认情况下进度条为蓝色,Bootstrap4 还提供了以下颜色的进度条:
<
div
class
=
"
progress
"
>
<
div
class
=
"
progress-bar bg-success
"
style
=
"
width:40%
"
>
div
>
div
>
<
div
class
=
"
progress
"
>
<
div
class
=
"
progress-bar bg-info
"
style
=
"
width:50%
"
>
div
>
div
>
<
div
class
=
"
progress
"
>
<
div
class
=
"
progress-bar bg-warning
"
style
=
"
width:60%
"
>
div
>
div
>
<
div
class
=
"
progress
"
>
<
div
class
=
"
progress-bar bg-danger
"
style
=
"
width:70%
"
>
div
>
div
>
尝试一下 »
可以使用 .progress-bar-striped
类来设置条纹进度条:
<
div
class
=
"
progress
"
>
<
div
class
=
"
progress-bar progress-bar-striped
"
style
=
"
width:40%
"
>
div
>
div
>
尝试一下 »
使用 .progress-bar-animated
类可以为进度条添加动画:
<
div
class
=
"
progress-bar progress-bar-striped progress-bar-animated
"
style
=
"
width: 40%
"
>
div
>
尝试一下 »
进度条可以设置多种颜色:
<
div
class
=
"
progress
"
>
<
div
class
=
"
progress-bar bg-success
"
style
=
"
width:40%
"
>
Free Space
div
>
<
div
class
=
"
progress-bar bg-warning
"
style
=
"
width:10%
"
>
Warning
div
>
<
div
class
=
"
progress-bar bg-danger
"
style
=
"
width:20%
"
>
Danger
div
>
div
>
尝试一下 »
网站栏目:创新互联Bootstrap4教程:Bootstrap4进度条
本文链接:http://www.shufengxianlan.com/qtweb/news29/104979.html
网站建设、网络推广公司-创新互联,是专注品牌与效果的网站制作,网络营销seo公司;服务项目有等
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联