Input label and Picture button horizontal alignment solution

Source: Internet
Author: User

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:


&lt;input type= "text" id= "Txtqty"/&gt;


&lt;asp:imagebutton id= "ibtnbuy" runat= "Server"/&gt;



As shown in the figure



In fact, just add a CSS attribute to the picture button:

Copy Code code as follows:


&lt;asp:imagebutton id= "ibtnbuy" runat= "Server" cssclass= "btnimg"/&gt;


. btnimg{Vertical-align:middle;}



So it's aligned:


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.