我刚开始写代码。但是我在我的CSS中遇到了一个错误。错误是我希望按钮居中对齐,但它不会对齐。
这可能很明显,但我不知道哪里出了问题。
请帮帮我。如果你愿意帮忙,我会很高兴。 这是我的代码:
<!DOCTYPE HTML>
<html>
<head>
<h1>Help</h1>
</head>
<body>
<br>
<a class="button" onClick='window.location="view-source:" + window.location.href' target="_blank">View Source</a>
</body>
<style>
h1 {
color: black;
text-align: center;
}
a[target=_blank] {
text-align: center;
}
.button {
text-align: center;
padding: 0 5px 5px 5px;
background-color: #dcdcdc;
border: 1px solid #666;
color: #000;
text-decoration: none;
font-family: "arial";
font-size: 100%;
}
</style>
</html>
我在网上找不到任何东西
最佳答案
如果你说你在网上没有找到任何东西,你一定根本没有尝试过。
阅读 margin
属性以及其余的 HTML 和 CSS 教程。
关于html - CSS 文本对齐。我不知道我的代码有什么问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33684646/