我要实现div相对td定位。设置td的position为relative后,td的border设置失效,是什么原因?

restring 2011-06-01 09:45:34
代码如下:
<html>
<head>
<title>demo</title>
</head>
<body>
<div
style="position: absolute; width: 716px; z-index: 1; left: 20px; top: 20px">
<table cellpadding="0" cellspacing="0"
style="table-layout: fixed; border-collapse: collapse; border: none;">
<tr height='91'>
<td align='left' valign='top' colspan='358' rowspan='1' width='358'
style="position: relative; display: block; border-left: 1px solid black; border-right: 1px solid black; border-top: 1px solid black; border-bottom: 1px solid black;">
<div
style="position: absolute; width: 70px; height: 21px; z-index: 1; left: 133px; top: 32px"><input
type="button" id='null' value='按钮1' x='133' y='32'
style='width: 70; height: 21'></input></div>
</td>
<td align='left' valign='top' colspan='358' rowspan='1' width='358'
style="position: relative; display: block; border-left: 1px solid black; border-right: 1px solid black; border-top: 1px solid black; border-bottom: 1px solid black;">
<div
style="position: absolute; width: 70px; height: 21px; z-index: 1; left: 130px; top: 32px"><input
type="button" id='null' value='按钮2' x='130' y='32'
style='width: 70; height: 21'></input></div>
</td>
</tr>
<tr height='91'>
<td align='left' valign='top' colspan='358' rowspan='1' width='358'
style="position: relative; display: block; border-left: 1px solid black; border-right: 1px solid black; border-top: 1px solid black; border-bottom: 1px solid black;">
<div
style="position: absolute; width: 70px; height: 21px; z-index: 1; left: 130px; top: 35px"><input
type="button" id='null' value='按钮3' x='130' y='35'
style='width: 70; height: 21'></input></div>
</td>
<td align='left' valign='top' colspan='358' rowspan='1' width='358'
style="border-left: 1px solid black; border-right: 1px solid black; border-top: 1px solid black; border-bottom: 1px solid black;"></td>
</tr>
</table>
</div>
</body>
</html>




中间那些border-left: 1px solid black; border-right: 1px solid black; border-top: 1px solid black; border-bottom: 1px solid black;都失效了
...全文
568 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

61,112

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧