css实现五个六边形排列
2017-05-19 16:40
239 查看
<!DOCTYPE
html><html><head>
<meta
http-equiv="Content-Type"
content="text/html; charset=utf-8"
/>
<title>CSS3
实现六边形图片展示效果</title>
<style
type="text/css">
body, div, img, ul, li { margin:
0; padding:
0;
} body
{ font-size:
12px; background-color:
#DDD; min-width:
1200px;
} ul, ul li
{ list-style:
none;
} .clear
{ clear:
both;
} .box
{ position:
relative; width:
630px; margin:
100px auto;
} .lineF, .lineS
{ position:
absolute; visibility:
hidden;
} .lineS
{ top:
182px; left:
105px;
} .boxF, .boxS, .boxT, .overlay
{ width:
200px; height:
250px; overflow:
hidden;
} .boxF, .boxS
{ visibility:
hidden;
} .boxF
{ transform:
rotate(120deg); float:
left; margin-left:
10px; -ms-transform:
rotate(120deg); -moz-transform:
rotate(120deg); -webkit-transform:
rotate(120deg);
} .boxS
{ transform:
rotate(-60deg); -ms-transform:
rotate(-60deg); -moz-transform:
rotate(-60deg); -webkit-transform:
rotate(-60deg);
} .boxT
{ transform:
rotate(-60deg); background:
no-repeat 50% center; background-size:
125% auto; -ms-transform:
rotate(-60deg); -moz-transform:
rotate(-60deg); -webkit-transform:
rotate(-60deg); visibility:
visible;
} .overlay
{ transition:
all 250ms ease-in-out 0s; display:
none; position:
relative;
} .overlay:hover
{ background-color:
rgba(0,0,0,0.6);
} .boxT:hover .overlay
{ display:
block;
} .overlay a
{ display:
inline-block; position:
absolute; left:
50%; top:
50%; margin:
-16px 0 0 -16px; border-radius:
3px; background-color:
#d3b850; text-align:
center; line-height:
32px; width:
32px; height:
32px; text-decoration:
none; color:
White; font-size:
18px; font-weight:
bolder;
}
</style></head><body>
<div
class="box">
<!--第一行(lineFirst)-->
<div
class="lineF">
<div
class="boxF">
<div
class="boxS">
<div
class="boxT"
style="background-image: url(img/1.jpg);">
<div
class="overlay">
<a
href="#">+</a>
</div>
</div>
</div>
</div>
<div
class="boxF">
<div
class="boxS">
<div
class="boxT"
style="background-image: url(img/2.jpg);">
<div
class="overlay">
<a
href="#">+</a>
</div>
</div>
</div>
</div>
<div
class="boxF">
<div
class="boxS">
<div
class="boxT"
style="background-image: url(img/3.jpg);">
<div
class="overlay">
<a
href="#">+</a>
</div>
</div>
</div>
</div>
</div>
<!--第二行(lineSecond)-->
<div
class="lineS">
<div
class="boxF">
<div
class="boxS">
<div
class="boxT"
style="background-image: url(img/4.jpg);">
<div
class="overlay">
<a
href="#">+</a>
</div>
</div>
</div>
</div>
<div
class="boxF">
<div
class="boxS">
<div
class="boxT"
style="background-image: url(img/5.jpg);">
<div
class="overlay">
<a
href="#">+</a>
</div>
</div>
</div>
</div>
</div>
</div></body></html>
html><html><head>
<meta
http-equiv="Content-Type"
content="text/html; charset=utf-8"
/>
<title>CSS3
实现六边形图片展示效果</title>
<style
type="text/css">
body, div, img, ul, li { margin:
0; padding:
0;
} body
{ font-size:
12px; background-color:
#DDD; min-width:
1200px;
} ul, ul li
{ list-style:
none;
} .clear
{ clear:
both;
} .box
{ position:
relative; width:
630px; margin:
100px auto;
} .lineF, .lineS
{ position:
absolute; visibility:
hidden;
} .lineS
{ top:
182px; left:
105px;
} .boxF, .boxS, .boxT, .overlay
{ width:
200px; height:
250px; overflow:
hidden;
} .boxF, .boxS
{ visibility:
hidden;
} .boxF
{ transform:
rotate(120deg); float:
left; margin-left:
10px; -ms-transform:
rotate(120deg); -moz-transform:
rotate(120deg); -webkit-transform:
rotate(120deg);
} .boxS
{ transform:
rotate(-60deg); -ms-transform:
rotate(-60deg); -moz-transform:
rotate(-60deg); -webkit-transform:
rotate(-60deg);
} .boxT
{ transform:
rotate(-60deg); background:
no-repeat 50% center; background-size:
125% auto; -ms-transform:
rotate(-60deg); -moz-transform:
rotate(-60deg); -webkit-transform:
rotate(-60deg); visibility:
visible;
} .overlay
{ transition:
all 250ms ease-in-out 0s; display:
none; position:
relative;
} .overlay:hover
{ background-color:
rgba(0,0,0,0.6);
} .boxT:hover .overlay
{ display:
block;
} .overlay a
{ display:
inline-block; position:
absolute; left:
50%; top:
50%; margin:
-16px 0 0 -16px; border-radius:
3px; background-color:
#d3b850; text-align:
center; line-height:
32px; width:
32px; height:
32px; text-decoration:
none; color:
White; font-size:
18px; font-weight:
bolder;
}
</style></head><body>
<div
class="box">
<!--第一行(lineFirst)-->
<div
class="lineF">
<div
class="boxF">
<div
class="boxS">
<div
class="boxT"
style="background-image: url(img/1.jpg);">
<div
class="overlay">
<a
href="#">+</a>
</div>
</div>
</div>
</div>
<div
class="boxF">
<div
class="boxS">
<div
class="boxT"
style="background-image: url(img/2.jpg);">
<div
class="overlay">
<a
href="#">+</a>
</div>
</div>
</div>
</div>
<div
class="boxF">
<div
class="boxS">
<div
class="boxT"
style="background-image: url(img/3.jpg);">
<div
class="overlay">
<a
href="#">+</a>
</div>
</div>
</div>
</div>
</div>
<!--第二行(lineSecond)-->
<div
class="lineS">
<div
class="boxF">
<div
class="boxS">
<div
class="boxT"
style="background-image: url(img/4.jpg);">
<div
class="overlay">
<a
href="#">+</a>
</div>
</div>
</div>
</div>
<div
class="boxF">
<div
class="boxS">
<div
class="boxT"
style="background-image: url(img/5.jpg);">
<div
class="overlay">
<a
href="#">+</a>
</div>
</div>
</div>
</div>
</div>
</div></body></html>
相关文章推荐
- css+js实现select列表横向排列效果代码
- div+css+js实现竖向排列的标签选项卡
- CSS实现图片背景填充的六边形
- css+js实现select列表横向排列效果代码
- CSS实现的中文字段的几种有趣排列方式
- CSS——实现图片等比例正方形显示,宫格排列
- css实现文字竖直排列 并且在div中居中显示
- CSS 图片横向排列实现代码
- CSS/DIV:不用float实现块状元素/block/的同行排列
- css实现文字居左日期居右排列最简单的网页代码
- 用DIV+CSS实现六边形
- 纯CSS实现六边形布局菜单效果
- css实现图片横向排列,溢出隐藏/滚动条横向拖动
- c# 输入五个数用冒泡排序法实现由大到小的排列
- css实现图片横向排列滚动
- css 实现六边形的两种方式,非canvas
- 纯CSS实现六边形布局的导航菜单
- css实现文字居左日期居右排列最简…
- CSS 图片横向排列实现代码
- CSS实现简单的横向排列demo