我试图将输入按钮与链接(类“按钮”)对齐,但在Safari和Chrome中,顶部有1像素差异,我无法弄清楚原因。如何将HTML按钮与链接对齐?
<input class="button" name="commit" type="submit" value="Enrol" />
<a href="#" class="button" id="cancel">Cancel</a>
input.button {
height: 38px;
font-size: 18px;
color: white;
font-weight: normal;
font-style: normal;
background: #4D28B2;
border: 1px solid gray;
padding: 5px;
}
a.button {
display: inline-block;
padding: 5px;
height: 24px;
font-size: 18px;
color: white;
text-decoration: none;
font-weight: normal;
font-style: normal;
text-align: left;
background-color: #4D28B2;
border: 1px solid gray;
}
有什么问题,我该怎么解决呢?
还应该包含您的HTML代码。 – 2010-11-24 15:26:20
你可以在这里看到效果:http://jsfiddle.net/sje397/R2Jzk/ – sje397 2010-11-24 15:34:31