【发布时间】:2015-05-28 04:41:14
【问题描述】:
目标:
将 "#" 和 "Firstname" 的第 th 设为悬停时的背景颜色为黄色
问题:
我不知道如何解决它。
信息:
在这种情况下,我不能使用<thead> 和<body>,我使用的是 Bootstrap 和 jQuery。
.makeThisOpacity {
opacity: 0;
}
.makeThisOpacity: hover {
background-color: yellow;
}
<html lang="en">
<head>
<title></title>
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.css" rel="stylesheet" />
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
</head>
<body>
<br>
<table class="table table-hover">
<tr>
<th class="makeThisOpacity">#</th>
<th class="makeThisOpacity">>First Name</th>
<th>Last Name</th>
<th>Username</th>
</tr>
<tr>
<td>1</td>
<td>Mark</td>
<td>Otto</td>
<td>@mdo</td>
</tr>
</table>
</body>
</html>
【问题讨论】:
-
I do not know how to solve it.嗯,首先你应该考虑让元素以某种方式可见然后...... -
不透明度:0;使元素完全透明,使其在进程中不可见。
标签: jquery html css twitter-bootstrap