why does height and top attribute not work when position is relative?

后端 未结 1 685
滥情空心
滥情空心 2021-01-01 00:53

This will position the box a little below the top

H
相关标签:
1条回答
  • 2021-01-01 01:54

    Your box can't have a height that's a percentage of its parent if its parent doesn't have a fixed height, because then the box wouldn't know how high it needs to be (typically such a parent would be body or some other wrapper element).

    As a direct consequence, top with a percentage won't have any effect either.

    0 讨论(0)
提交回复
热议问题