CSS 100 percent height body and element

前端 未结 7 583
野性不改
野性不改 2021-01-02 06:41

I am having an issue making one of my elements 100% within an overall layout that is 100%.

I have tried different positioning solutions and I either end up with hidd

7条回答
  •  無奈伤痛
    2021-01-02 07:09

    Another solution is to use javascript (obviously not the cleanest way but in some cases it can be useful).

    Using jQuery:

    //Get height
    var divHeight = $('#div').height();
    
    //Apply css rule
    $('#anotherDiv').css('height', divHeight);
    

提交回复
热议问题