css实现div内图片的垂直、水平居中
2011-05-31 16:19
926 查看
无标题文档
.img_v {
display:table-cell !important;
display:block;
position:static !important;
position:relative;
overflow:hidden;
width:400px;
height:400px;
border:1px solid #000;
vertical-align:middle;
text-align:center;
}
.img_v p {
display:table-cell !important;
display:block;
margin:0;
position:static !important;
position:absolute;
top:50%;
left:50%;
width:400px;
margin-left:auto;
margin-right:auto;
}
.img_v img {
position:static !important;
position:relative;
top:auto !important;
top:-50%;
left:auto !important;
left:-50%;
}
.img_v {
display:table-cell !important;
display:block;
position:static !important;
position:relative;
overflow:hidden;
width:400px;
height:400px;
border:1px solid #000;
vertical-align:middle;
text-align:center;
}
.img_v p {
display:table-cell !important;
display:block;
margin:0;
position:static !important;
position:absolute;
top:50%;
left:50%;
width:400px;
margin-left:auto;
margin-right:auto;
}
.img_v img {
position:static !important;
position:relative;
top:auto !important;
top:-50%;
left:auto !important;
left:-50%;
}
相关文章推荐
- 纯css实现未知尺寸图片在DIV中垂直水平居中(超简单)
- css实现图片在div中水平和垂直居中(但图片宽高要小于div宽高)
- 纯CSS实现图片水平垂直居中于DIV(图片未知宽高)
- 纯CSS实现图片水平垂直居中于DIV(图片未知宽高)
- 纯CSS实现图片水平垂直居中于DIV(图片未知宽高)
- 纯CSS实现图片水平垂直居中于DIV(图片未知宽高)
- CSS实现图片水平垂直居中于DIV
- 纯css实现文字及图片水平垂直居中
- 【DIV+CSS】DIV背景图片水平垂直居中
- CSS布局:图片在DIV中上下左右居中(水平和垂直都居中)
- css实现图片水平垂直居中
- CSS +Div水平垂直居中实现
- 纯CSS实现未知高宽的图片在容器中水平和垂直居中
- 实现div里的img图片水平垂直居中
- 用css实现图片在div内的垂直居中
- css实现div水平、垂直居中兼容chrome、ie8
- CSS实现div水平垂直居中
- CSS实现DIV水平 垂直居中-1
- CSS实现文字和图片的水平垂直居中
- css实现div的水平垂直居中方法