300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > html5文字图片垂直居中代码 css实现文字图片垂直居中效果

html5文字图片垂直居中代码 css实现文字图片垂直居中效果

时间:2021-10-22 06:15:36

相关推荐

html5文字图片垂直居中代码 css实现文字图片垂直居中效果

复制代码代码如下:

轻松实现:垂直居中文字图片

html{

font-size:12px;

}

.control{

width:600px;

border:1px solid #000;

padding:10px;

margin:0 auto;

}

.main_header{

border:1px solid blue;

height:100px

}

.main_body{

border:1px solid red;

height:500px

}

.main_footer{

border:1px solid #ccc;

height:100px

}

.main_header,.main_body,.main_footer{

margin-bottom:5px;

}

.content{

width:102px;

margin:10px auto;

overflow:hidden;

}

.content .info{

width:100px;

height:200px;

border:1px solid green;

display:table-cell;

vertical-align:middle;

margin:0 auto;

}

.content .fix{

display:inline;

width:0;

height:100%;

vertical-align:middle;

zoom:1; /*触发IE hasLayout*/

}

.content .desc{

display:inline;

width:100%;

vertical-align:middle;

zoom:1; /*触发IE hasLayout*/

}

.content .img{

float:left;

width:100px;

height:100px;

border:1px solid #333;

line-height:100px;

text-align:center;

*font-size:100px; /* IE */

}

.content img{

vertical-align:middle;

}

header

无霜制冷,不仅节能省电,还免去除霜烦恼。冷冻速度快,食材由内到外均匀冻透,保鲜效果好,口感新鲜,更能锁住营养不流失。

footer

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。