jqueryui css中.ui状态下的ovrreride锚定样式
我正在为我的表使用Jquery UI css,使用Jquery函数应用样式。对于鼠标在所有td标记上的每一行,都会得到一个css类ui状态悬停,该类定义锚定的颜色jqueryui css中.ui状态下的ovrreride锚定样式,css,jquery-ui,Css,Jquery Ui,我正在为我的表使用Jquery UI css,使用Jquery函数应用样式。对于鼠标在所有td标记上的每一行,都会得到一个css类ui状态悬停,该类定义锚定的颜色 .ui-state-hover a, .ui-state-hover a:hover, .ui-state-hover a:link, .ui-state-hover a:visited { color: #212121; text-decoration: none; } 我不希望表中的锚点使用颜色#212121,
.ui-state-hover a,
.ui-state-hover a:hover,
.ui-state-hover a:link,
.ui-state-hover a:visited {
color: #212121;
text-decoration: none;
}
我不希望表中的锚点使用颜色#212121,并保留来自css的默认蓝色
a,
a:link,
a:active {
text-decoration: none;
color: blue ;
background-color: transparent;
}
a:visited {
color: purple ;
background-color: transparent;
}
a:hover {
text-decoration: underline;
}
我不想添加!重要信息在我的css中锚定颜色样式,因为它在全局范围内起作用。
建议我如何覆盖。ui状态悬停颜色。
我的hmtl代码
<html>
<head>
<!--<script type="text/javascript" src="../jquery-ui-1.11.1/external/jquery/jquery.js"/>
<link type="text/css" src="../jquery-ui-1.11.1/jqueryui.css">
<script type="text/javascript" src="../jquery-ui-1.11.1/jqueryui.js"/>
-->
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<style>
body {
font-family: 'Arial';
font-size: 12px;
}
a,
a:link,
a:active {
text-decoration: none;
color: blue ;
background-color: transparent;
}
a:visited {
color: purple ;
background-color: transparent;
}
a:hover {
text-decoration: underline;
}
a.ui-state-hover{
color: blue !important;
}
</style>
<script>
$(document).ready(function(){
tblCss();
});
var tblCss =function(){
$("table").each(function(){
jqueryUITbl(this);
});
}
var jqueryUITbl =function(tbl){
$this = $(tbl);
$this.on('mouseover mouseout', 'tbody tr', function (event) {
console.log(' mouseover')
$(this).children('td').toggleClass("ui-state-hover", event.type == 'mouseover');
});
$this.find("caption").addClass("ui-widget-header ui-corner-all");
$this.find("th").addClass("ui-widget-header ui-corner-all");
$this.find("td").addClass("ui-widget-content");
}
</script>
</head>
<body>
<br/>
<table>
<tr>
<th> Clumns1</th>
<th> Column2</th>
</tr>
<tr>
<td>
Some text
</td>
<td>
<a href=""> Test link </a>
</td>
</tr>
<tr>
<td>
Some text
</td>
<td>
<a href=""> Test link </a>
</td>
</tr>
<tr>
<td>
Some text
</td>
<td>
<a href=""> Test link </a>
</td>
</tr>
</table>
</body>
</html>
身体{
字体系列:“Arial”;
字体大小:12px;
}
A.
答:林克,
a:主动的{
文字装饰:无;
颜色:蓝色;
背景色:透明;
}
a:参观了{
颜色:紫色;
背景色:透明;
}
a:悬停{
文字装饰:下划线;
}
a、 ui状态悬停{
颜色:蓝色!重要;
}
$(文档).ready(函数(){
tblCss();
});
var tblCss=函数(){
$(“表”)。每个(函数(){
jqueryUITbl(本);
});
}
var jqueryUITbl=函数(待定){
$this=$(待定);
$this.on('mouseover mouseout','tbody tr',函数(事件){
console.log('mouseover')
$(this).children('td').toggleClass(“ui状态悬停”,event.type=='mouseover');
});
$this.find(“caption”).addClass(“ui小部件头ui角全部”);
$this.find(“th”).addClass(“ui小部件头ui角点全部”);
$this.find(“td”).addClass(“ui小部件内容”);
}
丛1
专栏2
一些文本
一些文本
一些文本
将css更改为
a,
a:link,
a:active, .ui-state-hover a {
text-decoration: none;
color: blue ;
background-color: transparent;
}
a:visited, .ui-state-hover a:visited {
color: purple ;
background-color: transparent;
}
a:hover, .ui-state-hover a:hover {
text-decoration: underline;
}
因为你的css在include之后,它会覆盖之前的css