height 100% in Chrome

前端 未结 4 1973
悲&欢浪女
悲&欢浪女 2021-02-02 00:00

I\'m having problems with a side div that won\'t get the height to 100% in Chrome. It works just fine in FF.

I\'m using:

html, body {

 padd         


        
4条回答
  •  孤独总比滥情好
    2021-02-02 00:34

    You have to specify your parent with 100% height as well as the child so

    html,body{
         height: 100%;
    }
    #div{
          min-height: 100%;
      height: auto !important;
      height: 100%; /*for IE*/
    }
    

    The !important will overwrite all other height rules. Try that you should have no problems.

提交回复
热议问题