基本CSS布局三------图片视频网格

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style type="text/css">
.video_list{
list-style-type: none;
}
.video_list li{
width: 15%;
float: left;
padding-bottom: 15%;
position: relative;
text-align: center;
font-size:35px;
margin-left: 1%;
margin-bottom: 1%;
}
.video_list div{
position: absolute;
background-color:rgb(106, 109, 106);
border:1px solid #ccc;
width: 100%;
height: 100%; }
.video_list span{
display: inline-block;
margin-top: 50%;
-webkit-transform: translateY(-50%);
-moz-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%); }
</style>
</head> <body>
<ul class="video_list">
<li><div><span>1</span></div></li>
<li><div><span>2</span></div></li>
<li><div><span>3</span></div></li>
<li><div><span>4</span></div></li>
<li><div><span>5</span></div></li>
<li><div><span>6</span></div></li>
<li><div><span>7</span></div></li>
<li><div><span>8</span></div></li>
<li><div><span>9</span></div></li>
</ul>
</body>
</html>

基本CSS布局三-LMLPHP

05-11 01:24