鍍金池/ 問答/Linux  HTML/ 設置display:table后,高度會失效

設置display:table后,高度會失效

設置display:table后,高度會失效,設置了77PX,但是高度還是會隨內(nèi)容的增加的增加

8ad4b31c8701a18bbef9f7a8952f07082938fec3.jpg

回答
編輯回答
撥弦

table肯定是自動撐高的,要么不設置display:table,要么在該層外面再嵌套一層div,設置這一層的div height為77px,overflow:hidden

<style>
.wrap{height:77px; overflow:hidden;}
.remarks{display:table;}
</style>

<div class="wrap">
    <div class="remarks">
        <p></p>
    </div>
</div>
2018年4月9日 23:15