H5+CSS3设计动态的首页背景

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>2016~2017热门语言排行榜</title>
<style type="text/css">
* {
margin: 0;
padding: 0;
}
body {
background: url(img/rain.jpg);
}
div {
width: 1139px;
margin: 50px auto;
}
li {
width: 205px;
height: 120px;
margin: 40px 10px;
background:  rgba(0,0,0,0.5);
list-style: none;
float: left;
position: relative;
z-index: 1;
/*opacity: 0.1;*/
}

li:nth-of-type(9n+6) {
margin-left: 120px;
}
li:before,li:after {
content: "";
width: 205px;
height: 120px;
background:  rgba(0,0,0,0.5);
position: absolute;
/*margin: 40px 10px;*/
}
li:before {
transform: rotate(-60deg);
z-index: 1;
}
li:after {
transform: rotate(60deg);
z-index: 1;
}
li p {
position: absolute;
top:50%;
left: 50%;
line-height: 90px;
color: white;
font-size: 2em;
display: block;
height: 3em;
width: 3em;
top: 0px;
right: 0px;
bottom: 0px;
left: 0px;
margin: auto;
text-align: center;
border-radius: 50%;
border: solid 5px white;
transition: 1s;
z-index: 5;
}
li:nth-of-type(1) p{
background: #2BB121;
}
li:nth-of-type(2) p{
background: #0864C1;
}
li:nth-of-type(3) p{
background: #7CBC00;
}
li:nth-of-type(4) p{
background: #1D5AF3;
}
li:nth-of-type(5) p{
background: #FF4100;
}
li:nth-of-type(6) p{
background: #F56E31;
}
li:nth-of-type(7) p{
background: #D33C28;
}
li:nth-of-type(8) p{
background: #1D5AF3;
}
li:nth-of-type(9) p{
background: #E35993;
}
li:nth-of-type(10) p{
background: #44B39C;
}
li:nth-of-type(11) p{
background: #1D5AF3;
}
li:nth-of-type(12) p{
background: #E35993;
}
li:nth-of-type(13) p{
background: #FF7400;
}
li:nth-of-type(14) p{
background: #483A82;
}
li:hover p{
transform: rotate(360deg) scale(1.5);
z-index: 5;
}
</style>
</head>
<body>
<div>
<ul>
<li><p title="JavaScript">JS</p></li>
<li><p>Java</p></li>
<li><p title="Python">Pyt</p></li>
<li><p>Ruby</p></li>
<li><p>PHP</p></li>
<li><p>C++</p></li>
<li><p>CSS</p></li>
<li><p>C#</p></li>
<li><p>C</p></li>
<li><p>Go</p></li>
<li><p>Shell</p></li>
<li><p title="Objective C">Obj-C</p></li>
<li><p>Scala</p></li>
<li><p>Swift</p></li>
</ul>
</div>
</body>

</html>

  • 2
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值