【发布时间】:2021-07-14 05:54:22
【问题描述】:
[我的网站图片1
嘿,如果你看到那张图片,那么我只是想知道如何将按钮放在中间,就像标题一样。就像直接在它下面一样,text-align 对我不起作用。
如果我的代码中有任何内容阻止按钮进入中心,请告诉我。 (我是 HTML 新手)
我的代码:
<html style = "background-color: lightblue;">
<b
><h1 id="chimp">
Welcome to Monkey Idle!
</h1></b
>
<a class="button" href="" style="text-decoration: none; color: black" id = "button">
Click Here to Play!
</a>
<a id="button2" class="button" href="" style="text-decoration: none; color: black;">
Played before? Click here!
</a>
<style>
#chimp {
text-align: center;
font-size: 50px;
font-family: cursive;
}
#moneycount {
border-style: solid;
}
#button2 {
text-align: center;
background color;
position:absolute;
left: 50%;
font-family: cursive;
background-color: white;
padding: 20px;
position: center;
align: center;
}
@keyframes buttonbounce {
0%{margin-left: 0px;}
100%{margin-left: 10px;}
}
#button2:hover {
animation: buttonbounce 0.1s infinite;
}
#button {
text-align: center;
background color;
position:relative;
font-family: cursive;
background-color: white;
padding: 20px;
}
</style>
</html>
【问题讨论】:
-
研究一下
标签: html css button center html-helper