Yesterday, small series of friends to consult, said he also encountered this problem, and use margin, padding and other CSS syntax, have not resolved.
The solution is actually very simple, we just add the Vertical-align:middle attribute to it.
To see the example:
<textarea id="runcode5"><input name= "jb51" type= "text" size= "value=" "style=" Vertical-align:middle "/> <center> If the effect cannot be displayed, please press CTRL+F5 to refresh this page </center></textarea>
Tip: You can modify some of the code before running
The page directly placed an input text box with the ImageButton Picture button, but found no alignment:
Copy Code code as follows:
<input type= "text" id= "Txtqty"/>
<asp:imagebutton id= "ibtnbuy" runat= "Server"/>
As shown in the figure
In fact, just add a CSS attribute to the picture button:
Copy Code code as follows:
<asp:imagebutton id= "ibtnbuy" runat= "Server" cssclass= "btnimg"/>
. btnimg{Vertical-align:middle;}
So it's aligned: