CSS implementation picture vertically horizontally centered code example in div:
The need to vertically center a picture in an element is still a lot of practical applications, and here's a code example to show you how to do this.
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">Div{width:500px;Height:500px;Border:1px solid Red;Display:Table-cell;text-align:Center;vertical-align:Middle;}</style></Head><Body><Div><imgsrc= "Tree.jpg"/></Div></Body></HTML>
The above code can achieve the horizontal vertical effect of the picture, perhaps the lower version of the IE7 browser is not supported, but in the near future is not a problem.
The original address is: http://www.softwhy.com/forum.php?mod=viewthread&tid=12956
For more information, refer to: http://www.softwhy.com/divcss/
CSS implementation picture vertically horizontally centered code instance in Div