我如何让我的链接保持中心。我想把它放在我的容器上方。它一直向左走。如果我改变浮动它会停止跳跃效果。我尝试设置边距,但无济于事。请帮助我想要跳跃悬停效果,但我不希望它向右或向左,而是在中心。除了我下面的代码之外,有谁知道让我的链接在悬停时跳转的另一种方法。
A.main:link, A.main:active, A.main:visited{
font-family: arial narrow;
color: #404040;
font-size: 20px;
text-align: center;
letter-spacing: 5px;
text-transform: lowercase;
font-weight: normal;
border:double;
float: left;
margin: 15px;
-webkit-transition: margin 0.5s ease-out;
-moz-transition: margin 0.5s ease-out;
-o-transition: margin 0.5s ease-out;
}
A.main:hover {
margin-top: 2px;
}
#container {
margin: 0px auto;
padding-left:15px;
width: 800px;
height: auto;
background: #000;
border-style:double;
box-shadow: 15px 15px 5px #333;
-moz-box-shadow: 10px 10px 5px #333;
-webkit-box-shadow: 10px 10px 5px #333;}
</head>
<body>
<div id="header">
</div>
<center>
<a href="file:///C|/Users/JESS/Desktop/URL" class="main">LINK</a>
<a href="file:///C|/Users/JESS/Desktop/URL" class="main">LINK</a>
<a href="file:///C|/Users/JESS/Desktop/URL" class="main">LINK</a>
<a href="file:///C|/Users/JESS/Desktop/URL" class="main">LINK</a>
<a href="file:///C|/Users/JESS/Desktop/URL" class="main">LINK</a>
<a href="file:///C|/Users/JESS/Desktop/URL" class="main">LINK</a>
</center>
<div id="container">
</div>