【发布时间】:2012-05-30 21:22:11
【问题描述】:
我最难使用 CSS,因为它看起来如此善变。需要帮助。
我希望我的“section.png”图像是可单击的标题栏,并且当您单击标题栏时表格会展开和折叠。
<table width="100%">
<tr>
<td width=80% align=left>
<font color="white" size="4"><strong> General Airport Information</strong></font>
</td>
<td align=right><font color="white" size="2">
<div id='oc5' style="border-style: none; vertical-align:bottom;">
<img src="http://.../images/expand.png" width="15" height="15" style="border-style: none; vertical-align:top;"> Show
</div></font>
</td>
</tr>
</table>
</div>
^^^ 上面“Div”中的所有内容都需要位于 section.png 图像的顶部。 ^^^
<div id="id5" style="display: none">
<table width=80% align="center">
<tr align="left">
<td colspan="2" align="right">
Hidden text - Until Header Bar is Clicked.
</td>
</tr>
</table>
</div>
关于这个问题,我已经四处寻找答案。我知道它与 CSS 和浮动或位置以及绝对或相对有关。 IDK,我想不通。有人可以引导我朝着正确的方向前进吗?
【问题讨论】:
-
您需要在点击时展开和折叠内容吗?
-
您的代码似乎不完整 - section.png 实际上并未出现在标记中。此外,第一个块中没有打开
<div>标记。 -
上个世纪停止使用。
-
请问您为什么使用表格? 标签在几年前也被贬值了。并且,通过将 section.png 设置为父 div 的背景图像来尝试@sha404 回答。
标签: css css-float css-position