0

我正在使用 Visual Studio 2010 和 jQuery 1.7。

假设我的页面完全覆盖了 div 宽度 100% 和高度 100%。

我只想选择一个特定的部分并更改该部分的 CSS,例如,用不同的颜色突出显示它。

我想使用 jQuery 突出显示 DIV 的特定部分

请帮帮我!!!!

更新

<html>
<head></head>
<body>
behind the whole html of the page this 
div overlay's the html tag
<div Style="width:100%; height:100%; z-index:100000;">
</div>
</body>
</html>

我不想选择像 bugmuncher.com 这样的文本

4

2 回答 2

0

对某个 div id 或类执行突出显示。

$('#id').css('backgroundColor', 'yellow');

确保使用 span 标签包装特定代码。

Your sentence with a <span id="id">highlighted</span> part.
于 2012-07-05T18:34:51.377 回答
0

也许试试jquery hilighter 插件。使用简单。

于 2012-07-05T18:58:09.793 回答