【发布时间】:2022-01-01 12:01:26
【问题描述】:
我尝试了多次但没有任何进展,我的理论是这是因为修改了元素的填充,如果我错了,请纠正我。
.button1{
padding-right: auto;
padding-left: 40px;
padding-top: 10px;
background-color: rgba(255, 166, 0, 0.671);
border-radius: 20px;
font-family: Roboto;
text-align: left;
font-size: 50;
display: inline-block;
margin-top: -20px;
cursor: pointer;
border: none;
}
在 HTML 文件中
<div align="center"><a href="someurl"><button class="button1"><p align="left">Continue</p></button></a></div>
【问题讨论】:
-
使用validator.w3.org/nu 验证返回许多错误。 1.
div元素上的align属性已过时。 2. 元素button不得作为a元素的后代出现。 3. 在此上下文中,元素p不允许作为元素button的子元素。 4.p元素上的align属性已过时。 -
而不是
40pxleft 尝试20pxleft padding 和20pxright -
补充@vee 所说的,使用无效的 HTML 绝不是一种选择。