CSS solution:

Source: Internet
Author: User

1.>

In Div, if the height is set to be smaller than 20px and the content is blank, the height setting in IE6 does not work, and IE sets a default height of 20px, the solution is to set font-size: 1px, which is to set the default font size to the minimum.

This problem does not exist in IE8 and Firefox.

2.>

Text, images, and form elements (text, button, single choice, multiple choice, etc.) are vertically centered in the middle, Code

  1   <  Label  Style  = "Display: inline-block; Vertical-align: middle ;"  >  Little bit by bit  </ Label  > <  Select  Name  = "F"  Style  = "Vertical-align: middle; display: inline-block ;"  > <  Option  >  Text alignment  </  Option  > </  Select  > 
2 < Input Name = "" Type = "Button" Value = "Vertical center" Style = "Vertical-align: middle ;" /> < IMG SRC = "../Images/icon_rss.gif" Style = "Vertical-align: middle ;" />
3

 

Text

Text alignment

Remember to add vertical-align: middle to form elements. Use lable to add text. Set the image to a text stream, that is, display: inlin; Vertical-align: middle: in IE6, if there is no text in front of the form and an empty label is added, the elements in the DIV are vertically centered. In this example, a label must exist.

Related Article

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.