How to get the height of a DIV considering inner element's margins?

前端 未结 11 3183
日久生厌
日久生厌 2021-02-20 04:20

Consider de following markup:

11条回答
  •  佛祖请我去吃肉
    2021-02-20 04:49

    This is a tricky question as what do you discern as the "appropriate" height. The height of the content inside including borders, what about padding, or the actual margin use? In general browser act fairly consistent on most things, but quirksmode can clear up what you need. (As a hint, if you need the actual margin used, its gonna hurt).

提交回复
热议问题