网页制作,用CSS实现图片垂直居中方法
!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"style type="text/css"!--body {margin:0;padding:0}div {width:500px;height:500px;line-height:500px;border:1px solid #ccc;overflow:hidden;position:relative;text-align:center;margin:auto}div p {position:static;+position:absolute;top:50%}img {position:static;+position:relative;top:-50%;left:-50%;width:276px;height:110px;vertical-align:middle}p:after {content:".";font-size:1px;vis...[ 查看全文 ]2016-02-19 标签: