【问题标题】:Responsive DataTables drop down background changes color on hover响应式 DataTables 下拉背景在悬停时更改颜色
【发布时间】:2015-11-05 23:00:48
【问题描述】:

我有一个网站使用带有引导样式的 jquery 响应式数据表,每当用户单击绿色加号按钮时,就会出现一个下拉菜单,然后当您将鼠标悬停在该下拉菜单上时,它会像这样与网站的背景相匹配。@ 987654321@

我会尝试发布我认为相关的代码,如果我错过了什么,请告诉我:

html:

<body>
    <div class="container">
    <table id="PastFiveYears" class="table table-striped table-bordered dt-responsive nowrap" cellspacing="0" width="100%">
    <h2> QB stats from 2009 to current {{curYear}} season</h2>
    <thead>
        <tr>
            <th>Last Name</th>
            <th>First Name</th>
        </tr>
    </thead>

    <tbody>
        <tr>
            <td>{{p.player.last_name}}</td>
            <td>{{p.player.first_name}}</td>
        </tr>            
    </tbody>
</body>

css:

body {
    background-image: url("green_cup.png");
    position: relative;
}

tr:nth-child(even) {
    background-color:#f1f1f1 !important

}

th{
    background-color:#f1f1f1

}

所以我想我真正要问的是,当我将鼠标悬停在它上面时,如何更改悬停下拉菜单的背景?

感谢您的任何帮助!对不起,如果这些问题是微不足道的,但我尝试搜索,但我不确定我到底想要做什么

【问题讨论】:

    标签: jquery html css twitter-bootstrap datatables


    【解决方案1】:

    如果您使用的是 chrome,请使用鼠标右键按下该行并按下检查元素。 现在您可以在按下 pin 按钮时将其标记为悬停。 比你需要看到它从哪里继承样式。 现在你有两个选择: 1) 覆盖样式,例如

     <style>
         table
         {
         color:red;
         }
    table::hover 
    {
    color:green;
    }
        </style>
    

    它将使所有表格都变成红色。和绿色悬停

    2)您可以搜索css并将其更改为

    祝你好运:-)

    【讨论】:

      猜你喜欢
      • 2014-02-02
      • 1970-01-01
      • 2020-05-10
      • 1970-01-01
      • 1970-01-01
      • 2019-03-17
      • 1970-01-01
      • 1970-01-01
      • 2018-02-02
      相关资源
      最近更新 更多