position: absolute without setting top/left/bottom/right?

前端 未结 2 1101
南笙
南笙 2020-11-27 19:54

Case #1:

I want to put a logo above the photo in the header in the default WordPress theme ( http://twentyelevendemo.wordpress.com/ )

My solution: add the

相关标签:
2条回答
  • 2020-11-27 20:38

    The standard generally says if top/bottom, left/right are auto, then default them to their position: static values:

    http://www.w3.org/TR/CSS2/visudet.html#abs-non-replaced-width

    http://www.w3.org/TR/CSS2/visudet.html#abs-non-replaced-height

    0 讨论(0)
  • 2020-11-27 20:48

    AFAIK, you should pay attention of hierarchical css rules, beacuse if you don't specify top, left and other attributes, they are inherited from parent element, or are set by defaults in browser's css. IMHO, it's better to initialize elements with your values.

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