Absolute Positioned Floating Header Jitters in Safari

前端 未结 6 800
刺人心
刺人心 2020-12-31 02:52

I have a simple JSFiddle of a single floating header here:

http://jsfiddle.net/zT9KQ/

Basically, this uses translate3d to kick in the GPU and ha

6条回答
  •  被撕碎了的回忆
    2020-12-31 03:28

    How about a little restructuring, like this: http://jsfiddle.net/me2loveit2/zT9KQ/6/

    html:

    Header

    CSS:

    .container {
        height: 300px;
        position: relative;
        overflow-y:scroll;
    }
    .content {
        height:1000px;
    }
    h1 {
        position: relative;
        top:0px;
        left:0px;
        margin: 0;
        width: 100%;
        background: black;
        color: white;
    }
    

提交回复
热议问题