我一直在尝试使用 CSS 将#refer
's 的ul
内容对齐在屏幕中央。
<div id="refer" style="border:1px solid red">
<ul>
<li><a href="#" class="circlelink">One</a>
</li>
<li><a href="#" class="circlelink">Two</a>
</li>
<li><a href="#" class="circlelink">Three</a>
</li>
</ul>
</div>
.circlelink {
display:block;
width:100px;
height:100px;
border-radius:50px;
font-size:20px;
color:#fff;
line-height:100px;
text-align:center;
text-decoration:none;
background:linear-gradient(to bottom, #719ECE, #719FCE);
}
.circlelink:hover {
text-decoration:none;
background:#719ECE;
box-shadow: 0 0 8px rgba(0, 0, 0, .8);
-webkit-transform: scale(1.05, 1.07);
-moz-transform: scale(1.05, 1.07);
}
#refer {
position:absolute;
top:20%;
width:100%;
margin-left:auto;
margin-right:auto;
}
#refer ul {
clear:both;
margin: 0;
padding: 0;
}
#refer ul li {
display:block;
position: relative;
float: left;
height: auto;
width: 200px;
padding: 0;
margin-left: 10px;
list-style: none;
text-align: center;
white-space: nowrap;
}