search

Home  >  Q&A  >  body text

absolute之整体布局实现

要实现如图的布局,我最先想到是将header与footer绝对定位,但是发现在移动端会出现bug,经查资料发现用absolute实现整体布局非常好,还挺简单的。

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

.header, .footer, .content { 

      positionabsolute

      left0

      right0

}.header {

    height48px

    top0

    z-index1

   /*other style*/  }.footer { 

    height52px

    bottom0;

    z-index1

    /*other style*/  }.content { 

    top48px

    bottom53px

    overflowauto

   /*other style*/ 

 }


ringa_leeringa_lee3091 days ago1244

reply all(0)I'll reply

No reply
  • Cancelreply