div css picture and text align up and down center

Source: Internet
Author: User

It's easy to align the picture with the text horizontally, but when you do this tree today, you get to center the picture up and down. I don't know how to do that.

Take the manual to see also can't see why, different browser to div support not one, the best browser is Firefox.

There are two attributes involved, one is line-height and the other is vertical-align. In IE, only need line-height can achieve this effect, but want to in Firefox and Opea inside also achieve such effect, must use Vertical-align, and this is the attribute must be defined in the image above, not defined on the div.

Div: <style type= "Text/css" ><!--a{  color: #6096cf;  Text-decoration:none;  font-size:12px;}. Divcss{width:500px;height:12px;vertical-align:middle;text-align:position;}. Divcss img{vertical-align:middle;/*optional*/}. divcss A{vertical-align:middle;/*optional*/}--></style>

  

Top-top top <div id= "AA" class= "divcss" > <a href= " Javascript:dopostback (' 1 ', ' A '); ">a--Marxist Marxism, Leninism, Mao thought, Deng theory </a></div>
<div id= "A" ></div>

div css picture and text align up and down center

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.