如图。 dom结构为 <div> <p> <label>some text</label> some text </p> <p> <label>some text</label> some text </p> </div> 现在的问题是:如果P里面的文本为空时(不包括label里面的text,图中address2的值为空),P的高度计算为0。导致CITY的值向上飘到address2那一行去了。
Text font-family Verdana,Arial,sans-serif font-size 10px font-weight 700 font-style normal font-size-adjust none color #444422 text-transform none text-decoration none letter-spacing normal word-spacing 0 line-height 15.5px text-align left vertical-align baseline direction ltr Background background-color transparent background-image none background-repeat repeat background-position 0 0 background-attachment scroll opacity 1 Box Model width 100px height 15.5px top auto right auto bottom auto left auto margin-top 0 margin-right 0 margin-bottom 0 margin-left 0 padding-top 0 padding-right 0