为什么这个输入按钮在 Chrome 中显示正确居中,但在 IE 或 Firefox 中显示在右侧。这是链接,它是右侧的第二个按钮:
网站:http://dallaspetsalive.org/about/
HTML:
<div style="float:center;text-align:center;">
<form action="http://linkhidden" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
<input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required>
<br /><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button" style="text-align:center;float:center;" >
</form>
</div>
这是 CSS:
input.button {
background: -moz-linear-gradient(center top , #E8E8E8 0%, #D1D1D1 100%) repeat scroll 0 0 transparent;
border: 1px solid #9D9D9D;
border-radius: 15px 15px 15px 15px;
box-shadow: 0 1px 0 #F5F5F5 inset;
color: #656464;
display: inline-block;
padding: 6px 12px;
text-shadow: 1px 1px 0 white;
}
最佳答案
属性 float: center
不存在。更改内联样式并添加以下内容:
float: none;
margin: 0 auto;
你的输入标签应该是
<input
type="submit"
value="Subscribe"
name="subscribe"
id="mc-embedded-subscribe"
class="button"
style="float:none; margin: 0 auto;"
/>
关于html - 为什么这个输入按钮在 Chrome 中正确居中显示,但在 IE 和 Firefox 中却没有?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16182287/