HTML:'浮动'在跨度上?

时间:2011-06-23 09:56:26

标签: html css

我有以下内容..

TD CSS

-webkit-border-horizontal-spacing: 0px;
-webkit-border-vertical-spacing: 0px;
background-attachment: scroll;
background-clip: border-box;
background-color: transparent;
background-image: none;
background-origin: padding-box;
border-bottom-color: #999;
border-bottom-style: solid;
border-bottom-width: 1px;
border-collapse: separate;
border-left-color: #999;
border-left-style: solid;
border-left-width: 1px;
border-right-color: #999;
border-right-style: solid;
border-right-width: 0px;
border-top-color: #CCC;
border-top-style: solid;
border-top-width: 1px;
color: black;
display: table-cell;
font-family: arial, sans-serif;
font-size: 13px;
height: 30px;
vertical-align: middle;
width: 459px;

TDHTML

<td class="lst-td" style="border-top:1px solid #ccc" width="100%">
  <div>content</div>
</td>

SPAN CSS

-webkit-border-horizontal-spacing: 0px;
-webkit-border-vertical-spacing: 0px;
background-attachment: scroll;
background-clip: border-box;
background-color: transparent;
background-image: none;
background-origin: padding-box;
border-bottom-color: black;
border-collapse: separate;
border-left-color: black;
border-right-color: black;
border-top-color: black;
color: black;
display: block;
float: right;
font-family: arial, sans-serif;
font-size: 13px;
height: 23px;
position: relative;
top: 5px;
white-space: nowrap;
width: 194px;
z-index: 5;

SPAN HTML

<span name="wrapSpan" class="wrapSpan" id="wrapSpan" style="white-space:     
nowrap;">
Content here!
</span>

基本上我希望跨越TD“坐”。问题是现在它正在切断它并在它之后显示。我该如何解决这个问题?

他们的定位如此......

<tr>
    <td>
    <span>
</tr>

2 个答案:

答案 0 :(得分:1)

你不能像这样坐在一个范围内。这不是有效的HTML。我会做以下......(仅显示重要的CSS)

<tr>
    <td><span></span></td>
</tr>

CSS

td {position: relative;}
span {position: absolute; top:0;left;0;}

答案 1 :(得分:0)

我认为你的意思是

<tr>
    <td>
        <span></span>
    </td>
</tr>

如何将position:relative;提供给td并将position:absolute;top:0;left:0;提供给范围?