HTML <a> tag positioning &amp; height</a>

时间:2013-11-03 16:08:36

标签: css html

我正在关注this教程,以便在我的网页上使用精美的按钮。

除了标签的高度外,其他所有功能都可以正常工作,如下图所示:

Screen capture

我只更改了颜色,教程中的代码相同!

提前感谢你们!

编辑:

HTML:

<a href="javascript:void(0);">Avanti</a>

CSS:

a {
position: relative;
    color: rgba(255,255,255,1);
    text-decoration: none;
    background-color: rgba(0,76,126,1);
    font-family: 'Oswald';
    font-weight: 700;
    font-size: 2em;
    display: block;
    padding: 4px;
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    border-radius: 8px;
    -webkit-box-shadow: 0px 9px 0px rgba(0,34,56,1), 0px 9px 25px rgba(0,0,0,.7);
    -moz-box-shadow: 0px 9px 0px rgba(0,34,56,1), 0px 9px 25px rgba(0,0,0,.7);
    box-shadow: 0px 9px 0px rgba(0,34,56,1), 0px 9px 25px rgba(0,0,0,.7);
    margin: 25px auto;
width: 160px;
text-align: center;

-webkit-transition: all .1s ease;
-moz-transition: all .1s ease;
-ms-transition: all .1s ease;
-o-transition: all .1s ease;
transition: all .1s ease;
}

a:active {
-webkit-box-shadow: 0px 3px 0px rgba(0,34,56,1), 0px 3px 6px rgba(0,0,0,.9);
-moz-box-shadow: 0px 3px 0px rgba(0,34,56,1), 0px 3px 6px rgba(0,0,0,.9);
box-shadow: 0px 3px 0px rgba(0,34,56,1), 0px 3px 6px rgba(0,0,0,.9);
position: relative;
top: 6px;
}

1 个答案:

答案 0 :(得分:-1)

尝试放置这段代码:

left: 100px;
top: 150px;

到你的a元素的CSS中 你可以自定义数字