2012-07-05 52 views
0

我正在使用Visual Studio 2010和jQuery 1.7。如何使用jQuery突出顯示DIV的特定部分?

假設我的頁面完全覆蓋了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

+1

請發佈一個(小)代碼示例,說明如何佈置HTML。 – Yuck 2012-07-05 18:30:54

+1

您需要將其包裝在''中,除非它全部在一行上,在這種情況下,您可以使用漸變,並且應該使用''。 – Ryan 2012-07-05 18:32:38

+0

試試這個>> http://www.1stwebdesigner.com/tutorials/jquery-complete-beginners-part-2/ – 2012-07-05 18:33:51

回答

0

文本要執行的一大亮點,以一定的div id或class。

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

確保使用span標籤包裝特定代碼。

Your sentence with a <span id="id">highlighted</span> part. 
相關問題