Why is this inline-block element pushed downward?

前端 未结 8 999
别那么骄傲
别那么骄傲 2020-11-21 04:45

Following is my code and I want to understand that why #firstDiv is being pushed downward by all browsers. I really want to understand the inner wo

8条回答
  •  日久生厌
    2020-11-21 05:22

    The default value for vertical-align in CSS is baseline & this rule is also apply with inline-block read this http://www.brunildo.org/test/inline-block.html

    Write vertical-align:top in your inline-block DIV.

    Check this http://jsfiddle.net/WGCyu/1/

提交回复
热议问题