【问题标题】:HTML CSS relative propertyHTML CSS 相关属性
【发布时间】:2012-12-13 10:20:59
【问题描述】:

我有以下场景。

<div id="wrapper" style="position: relative">
  <div id="header">
   <div id="logout" style="position: absolute"></div>
  </div>
</div>

logout div 如何定位:它是相对于wrapper 还是相对于header

【问题讨论】:

  • 写题时请使用正确的句子结构,包括句号等。

标签: css html css-position


【解决方案1】:

您的#logout div 相对于具有position: relative 属性的 div - 您的包装器


一个DEMO 来证明它是正确的并且#logout 是相对于#wrapper

【讨论】:

  • @JoSo 您对问题的编辑是错误的。请注意这一行 "I have Div called wrapper which has position relative" 你为什么把绝对放在那里?
猜你喜欢
  • 2013-07-25
  • 1970-01-01
  • 2013-03-16
  • 1970-01-01
  • 2023-03-03
  • 2021-05-03
  • 2013-04-08
  • 1970-01-01
  • 2023-03-29
相关资源
最近更新 更多