Why setting the Vertical-align vertical Center does not work:
The Vertical-align property may not be used too frequently, but sometimes it is possible to align the elements vertically with the Vertical-align:middle setting inside the object, but sometimes you find that this setting does not always produce an effect. The code example is as follows:
<!DOCTYPE HTML><HTML><Head><MetaCharSet= "Utf-8"><Metaname= "Author"content= "http://www.softwhy.com/" /><title>Ant Tribe</title><styletype= "Text/css">TD{width:200px;Height:200px;Border:1px solid Red;vertical-align:Bottom;}Div{width:60px;Height:60px;Background-color:#690;}</style></Head><Body><Table> <TR> <TD><Div></Div></TD> </TR></Table></Body></HTML>
As you can see from the above code, the Vertical-align attribute works. Take another look at the example code:
<!DOCTYPE HTML><HTML><Head><MetaCharSet= "Utf-8"><Metaname= "Author"content= "http://www.softwhy.com/" /><title>Ant Tribe</title><styletype= "Text/css">. Parent{width:200px;Height:200px;Border:1px solid Red;vertical-align:Bottom;}. Children{width:60px;Height:60px;Background-color:#690;}</style></Head><Body><Divclass= "Parent"> <Divclass= "Children"></Div></Div></Body></HTML>
As you can see from the above code, the Vertical-align property here does not work. This is because this property can only be applied to elements with the Valign property, the table element has the Valign property, and the DIV element does not, so the Vertical-align property in the second example does not work.
The original address is: http://www.51texiao.cn/div_cssjiaocheng/2015/0503/587.html
The most original address is: http://www.softwhy.com
Why does setting the Vertical-align vertical Center not work