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
    评论
很好,购物商城网页是一个非常常见的网页类型,可以用HTML5和CSS设计。下面是一个简单的示例: ```html <!DOCTYPE html> <html> <head> <title>购物商城</title> <meta charset="utf-8" /> <style> /* 设置字体和背景颜色 */ body { font-family: Arial, sans-serif; background-color: #f1f1f1; } /* 设置导航栏样式 */ ul { list-style-type: none; margin: 0; padding: 0; overflow: hidden; background-color: #333; } li { float: left; } li a { display: block; color: white; text-align: center; padding: 14px 16px; text-decoration: none; } li a:hover { background-color: #111; } /* 设置商品展示区域 */ .product-container { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; margin-top: 20px; } .product { width: 300px; margin: 10px; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2); transition: 0.3s; } .product:hover { box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2); } .product img { width: 100%; height: 200px; } .product-name { font-weight: bold; margin-top: 10px; } .product-price { color: red; font-size: 20px; margin-top: 10px; } /* 设置页脚 */ footer { text-align: center; padding: 10px; background-color: #333; color: white; position: fixed; bottom: 0; width: 100%; } </style> </head> <body> <!-- 导航栏 --> <ul> <li><a class="active" href="#">首页</a></li> <li><a href="#">服装</a></li> <li><a href="#">鞋子</a></li> <li><a href="#">配件</a></li> <li style="float:right"><a href="#">登录</a></li> </ul> <!-- 商品展示区域 --> <div class="product-container"> <div class="product"> <img src="https://via.placeholder.com/300x200.png?text=Product+1" /> <div class="product-name">商品1</div> <div class="product-price">¥ 100</div> </div> <div class="product"> <img src="https://via.placeholder.com/300x200.png?text=Product+2" /> <div class="product-name">商品2</div> <div class="product-price">¥ 200</div> </div> <div class="product"> <img src="https://via.placeholder.com/300x200.png?text=Product+3" /> <div class="product-name">商品3</div> <div class="product-price">¥ 300</div> </div> <div class="product"> <img src="https://via.placeholder.com/300x200.png?text=Product+4" /> <div class="product-name">商品4</div> <div class="product-price">¥ 400</div> </div> <div class="product"> <img src="https://via.placeholder.com/300x200.png?text=Product+5" /> <div class="product-name">商品5</div> <div class="product-price">¥ 500</div> </div> <div class="product"> <img src="https://via.placeholder.com/300x200.png?text=Product+6" /> <div class="product-name">商品6</div> <div class="product-price">¥ 600</div> </div> </div> <!-- 页脚 --> <footer> <p>© 2021 购物商城</p> </footer> </body> </html> ``` 这个示例包含了一个导航栏、一个商品展示区域和一个页脚。你可以根据实际需求添加其他元素和样式。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值