Overlay with spinner

前端 未结 6 1198
忘了有多久
忘了有多久 2021-01-30 16:15

I\'m trying to create an overlay that overlays a page with a spinner in the middle. What\'s the simplest way to accomplish this? I only need to worry about IE 8 and above.

6条回答
  •  隐瞒了意图╮
    2021-01-30 17:00

    #overlay {
        position: fixed;
        width: 100%;
        height: 100%;
        background: black url(spinner.gif) center center no-repeat;
        opacity: .5;
    }
    

    it's better to use rgba color instead of opacity to prevent applying alpha to spinner image.

    background: rgba(0,0,0,.5) url(spinner.gif) center center no-repeat;
    

提交回复
热议问题