2013-12-14 55 views
0

使用JQuery移动1.3.2我有麻烦设置一些链接的样式。我不希望所有链接看起来都一样,所以有些将使用一种风格,而另一些则使用不同的风格。我试图添加自己的自定义类,甚至重写JQuery样式;然而,这两次尝试都没有成功。样式表规则应用程序

我已创建http://jsfiddle.net/qdz9b/1/来帮助说明我的问题。

自定义样式表

.ui-link{color:#000000;} 
.ui-link:visited{color:#000000} 
.myLink{color:#000000;} 
.aDifferentLink{color:#FF0000;} 

.myImportantLink{color:#000000 !important;} 

的HTML

<a href="#test">basic link, no custom class</a><br/> 
<a href="#test" class="myLink">link with custom class, not working either.</a><br/> 
<a href="#test" class="aDifferentLink">a different link, should be red. not working either.</a><br/> 
<br> 
<a href="#test" class="myImportantLink">link with !important class, the only way I can get it to work.</a><br/> 

渲染HTML

<a href="#test" class="ui-link">basic link, no custom class</a> 
<a href="#test" class="myLink ui-link">link with custom class, not working either.</a> 
<a href="#test" class="aDifferentLink ui-link">a different link, should be red. not working either.</a> 
<a href="#test" class="myImportantLink ui-link">link with !important class, the only way I can get it to work.</a> 

我缺少什么(jQuery的CSS加载后)?

在此先感谢!

杰克

回答