bootstrap占位骨架图效果代码

代码语言:html

所属分类:布局界面

代码描述:bootstrap占位骨架图效果代码

代码标签: bootstrap 占位 骨架图

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/bootstrap.4.3.1.min.css">
    <style>
    /** * placeholder-loading v0.2.2 * Author:Zalog (https://www.zalog.ro/) * License:MIT **/.ph-item {
	position:relative;
	display:flex;
	flex-wrap:wrap;
	padding:30px 15px 15px 15px;
	overflow:hidden;
	margin-bottom:30px;
	background-color:#fff;
	border:1px solid #e6e6e6;
	border-radius:2px;
}
.ph-item,.ph-item *,.ph-item::after,.ph-item::before {
	box-sizing:border-box;
}
.ph-item::before {
	content:" ";
	position:absolute;
	top:0;
	right:0;
	bottom:0;
	left:50%;
	z-index:1;
	width:500%;
	margin-left:-250%;
	-webkit-animation:phAnimation 0.8s linear infinite;
	animation:phAnimation 0.8s linear infinite;
	background:linear-gradient(to right,rgba(255,255,255,0) 46%,rgba(255,255,255,0.35) 50%,rgba(255,255,255,0) 54%) 50% 50%;
}
.ph-item >* {
	flex:1 1 auto;
	display:flex;
	flex-flow:column;
	padding-right:15px;
	padding-left:15px;
}
.ph-row {
	display:flex;
	flex-wrap:wrap;
	margin-bottom:7.5px;
}
.ph-row div {
	height:10px;
	margin-bottom:7.5px;
	background-color:#ced4da;
}
.ph-row .big,.ph-row.big div {
	height:20px;
	margin-bottom:15px;
}
.ph-row .empty {
	background-color:rgba(255,255,255,0);
}
.ph-col-2 {
	flex:0 0 16.66667%;
}
.ph-col-4 {
	flex:0 0 33.33333%;
}
.ph-col-6 {
	flex:0 0 50%;
}
.ph-col-8 {
	flex:0 0 66.66667%;
}
.ph-col-10 {
	flex:0 0 83.33333%;
}
.ph-col-12 {
	flex:0 0 100%;
}
.ph-avatar {
	position:relative;
	width:100%;
	min-width:60px;
	background-color:#ced4da;
	margin-bottom:15px;
	border-radius:50%;
	overflow:hidden;
}
.ph-avatar::before {
	content:" ";
	display:block;
	padding-top:100%;
}
.ph-picture {
	width:100%;
	height:120px;
	background-color:#ced4da;
	margin-bottom:15px;
}
@-webkit-keyframes phAnimation {
	0% {
	transform:translate3d(-30%,0,0);
}
100% {
	transform:translate3d(30%,0,0);
}
}@keyframes phAnimation {
	0% {
	transform:translate3d(-30%,0,0);
}
100% {
	transform:translate3d(30%,0,0);
}
}body {
	background-color:#e9ecef;
}
header,footer {
	padding:20px 0;
}
.container-fluid {
	max-width:600px;
}

    </style>
</head>

<body>
    <main class="container-fluid">
        <h2 class="h4">Generic placeholder</h2>
        <div class="ph-item">
            <div class="ph-col-12">
                <div class="ph-picture"></div>
                <div class="ph-row">
                    <div class="ph-col-6 big"></div>
                    <div class="ph-col-4 empty big"></div>
                    <div class="ph-col-2 big"></div>
                    <div class="ph-col-4"></div>
                    <div class="ph-col-8 empty"></div>
                    <div class="ph-col-6"></div>
                    <div class="ph-col-6 empty"></div>
                    <div class="ph-col-12"></div>
                </div>
            </div>
        </div>
        <h2 class="h4">Placeholder in a external twitter bootstrap grid</h2>
        <div class="row">
            <div class="col-12 col-sm-6">
                <div class="ph-item">
                    <div class="ph-col-12">
                        <div class="ph-picture"></div>
                        <div class="ph-row">
                            <div class="ph-col-4"></div>
                            <div class="ph-col-8 empty"></div>
                            <div class="ph-col-12"></div>
                        </div>
                    </div>
                    <div class="ph-col-2">
                        <div class="ph-avatar"></div>
                    </div>
                    <div>
                        <div class="ph-row">
                            <div class="ph-col-12"></div>
                            <div class="ph-col-2"></div>
                            <div class="ph-col-10 empty"></div>
                            <div class="ph-col-8 big"></div>
                            <div class="ph-col-4 big empty"></div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-12 col-sm-6">
                <div class="ph-item">
                    <div class="ph-col-12">
                        <div class="ph-picture"></div>
                        <div class="ph-row">
                            <div class="ph-col-4"></div>
                            <div class="ph-col-8 empty"></div>
                            <div class="ph-col-12"></div>
                        </div>
                    </div>
                    <div class="ph-col-2">
                        <div class="ph-avatar"></div>
                    </div>
                    <div>
                        <div class="ph-row">
                            <div class="ph-col-12"></div>
                       .........完整代码请登录后点击上方下载按钮下载查看

网友评论0