我試圖將輸入按鈕與鏈接(類「按鈕」)對齊,但在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