【发布时间】:2018-02-07 17:57:52
【问题描述】:
我正在尝试突出显示表格内部的 div 部分,但它似乎仅限于表格的宽度。滚动后的部分没有高亮显示。
我可以在div中添加样式,例如:“width:400px !important”,但我事先不知道宽度是多少。
有什么简单的解决办法吗?
.area1{
border:1px solid;
height:200px;
overflow:scroll;
float: left;
font-size: 16px;
}
.area1Content{
height:500px;
font-size: 16px;
white-space:nowrap;
}
<div id="area1Id" class="area1">
<table>
<tr>
<td style="min-width:300px; max-width:300px"><div id="area1ContentId" class="area1Content">
<div style="BACKGROUND-COLOR:cyan;">Test long text sentence that will exceed the box width. I want that all the sentence will be highlighed</div>
</div>
</td>
</tr>
</table>
</div>
【问题讨论】: