CSS3和HTML5头部定位自用

和自甴很熟 提交于 2019-11-26 12:34:02
body{
    max-width: 540px;
    min-width: 320px;
    margin: 0 auto;
    font: normal 14px/1.5 tahoma;
    color: #000;
    /* background-color: #f2f2f2; */
    overflow-x:hidden;
    -webkit-tap-highlight-color: transparent;/* 清除点击高亮效果 */
}

/* 顶部搜索框 */
.top-box{
    display: flex;
    /* 固定定位和父级没有关系 */
    width: 100%;
    height: 44px;
    position: fixed;
    left: 50%;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%);/* left 和 此属性可以不给 */
    top: 0;
    max-width: 540px;
    min-width: 320px;
    background-color: #f6f6f6;
    
}

 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!