首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在iphone的css中居中显示图像

在iphone的css中居中显示图像
EN

Stack Overflow用户
提问于 2013-04-15 02:35:33
回答 1查看 806关注 0票数 1

徽标bere: San-Francisco-Family-Photorapher.com

在iphone上,图像不会居中。

代码语言:javascript
复制
 .header-image #header #title-area {
    background: url("http://www.san-francisco-family-photographer.com/wp-content/uploads/2013/04/Joey-Chandler-Photographer-square.png") no-repeat scroll center center transparent;
    background-position: center;
    height: 130px!important;
    width: 180px!important;
}

.header-image #title-area, .header-image #title, .header-image #title a {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

谢谢。

EN

回答 1

Stack Overflow用户

发布于 2013-04-15 02:45:56

您可以将其放在div中并居中。

代码语言:javascript
复制
div#image {
    background: #282;
    width:130px;
    height:130px;
    position:absolute;
    top:0;
    bottom:0;
    left:0;
    right:0;
    margin:auto;
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16002817

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档