2011-06-23 51 views
1

我有以下..HTML:'span'上的跨度?

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> 
+1

能否請您告訴我們在哪兒被定位在HTML中跨度? –

+0

Woops!編輯。希望這足夠了! – Skizit

+0

這是非法的HTML。表格行不能包含範圍。 – RoToRa

回答

0

我相信你的意思

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

什麼讓position:relative;到TD和position:absolute;top:0;left:0;的跨度?

1

你不能坐在這樣一個tr裏面。這不是有效的HTML。我會做以下...(只顯示了重要的CSS)

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

CSS

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