html - Text in <a> tag is not vertically centered -


i have used following code , seeking why "upload" text rendered over-line?

<form id="form1" runat="server"> <table style="width: 100%; direction: rtl;">     <tr>       <td style="width: 100px; margin: 0px 5px 0px 5px;">            <div style="text-align:center;display:block;position: relative; height: 30px;" onclick="inform();">                 <a runat="server" id="uploadbtn" class="btn">upload</a>                                 </div>       </td>    </tr> </table> 

with following css:

.btn{     -webkit-border-radius: 3px;     -moz-border-radius: 3px;     border-radius: 3px;     background-color: #a19e86;     background-image: -moz-radial-gradient(center -100%, ellipse cover, #a19e86, #5e5c49 100%);     background-image: -webkit-radial-gradient(center -100%, ellipse cover, #a19e86, #5e5c49 100%);     background-image: -o-radial-gradient(center -100%, ellipse cover, #a19e86, #5e5c49 100%);     background-image: -ms-radial-gradient(center -100%, ellipse cover, #a19e86, #5e5c49 100%);     background-image: radial-gradient(center -100%, ellipse cover, #a19e86, #5e5c49 100%);     border: none;     box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.4);     color: #fff;     display: inline-block;     font-size: 16px;     font-style: italic;     font-family: 'crimson text' , times;     text-decoration: none;     -webkit-font-smoothing: antialiased; }  #uploadbtn{     height: 30px;     width: 100px;     z-index: 10001;     top: 0px;     line-height: 20px; } 

if you're going vertically center text using line-height should using line-height value equal height of <a> (30px) - right have set 20px.

#uploadbtn {     height: 30px;     width: 100px;     z-index: 10001;     top: 0px;     line-height: 30px; } 

http://jsfiddle.net/4gjs9/1/


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -