开发者社区 问答 正文

UC手机浏览器下如何让div水平垂直居中

globalTip{
    position: fixed;
    left: 0;
    right: 0;
    top:0;
    bottom:0;
    z-index: 99999;
    width:75%;
    height: 50px;
    line-height: 50px;
    text-align: center;
    background-color: #000;
    color:#fff;
    font-size: 1.6rem;
    border-radius: 20px;
}

如果position:absolute就可以,但这并不是我想要的。

展开
收起
杨冬芳 2016-06-02 15:09:22 2337 分享 版权
1 条回答
写回答
取消 提交回答
  • IT从业

    display: table-cell;
    vertical-align: middle;

    2019-07-17 19:24:57
    赞同 展开评论