【发布时间】:2015-03-18 05:28:23
【问题描述】:
基本上,下图总结了我的问题。
有什么优雅的解决方案可以让它发挥作用吗?我尝试使用rotate、skew 和perspective,但对我不起作用。
注意:背景需要透明。
我的代码给你。 :)
* { box-sizing: border-box; }
body { font: normal 16px sans-serif; }
.spaceship {
height: 430px;
position: relative;
width: 140px;
}
.spaceship::before {
background: #006dd9;
border-radius: 100%;
content: '';
height: 70px;
position: absolute;
width: 140px;
z-index: 1;
}
.abduction {
background: #0f0;
height: 370px;
left: 20px;
padding-top: 10px;
position: absolute;
top: 60px;
width: 100px;
}
.abduction a {
color: #fff;
display: block;
height: 60px;
padding-top: 25px;
text-align: center;
text-decoration: none;
text-transform: uppercase;
transition: background 500ms;
}
.abduction a:nth-child(even) { background: #00d900; }
.abduction a:hover { background: #008c00; }
<div class="spaceship">
<div class="abduction">
<a href="#">Button 1</a>
<a href="#">Button 2</a>
<a href="#">Button 3</a>
<a href="#">Button 4</a>
<a href="#">Button 5</a>
<a href="#">Button 6</a>
</div>
</div>
【问题讨论】:
标签: css rotation transform perspective skew