日期时间选择器从我的表继承样式 [英] Datetime picker inherits style from my table

查看:76
本文介绍了日期时间选择器从我的表继承样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用eonasdan中的日期选择器( https://github.com/Eonasdan/bootstrap-datetimepicker )

I'm using the datepicker from eonasdan (https://github.com/Eonasdan/bootstrap-datetimepicker)

它很好用,但是当我将它放在表中时,它会继承表的样式.好像日期选择器也变成了表格.

It works great, but when I put it inside a table, it inherits the style of the table. It is as if the datepicker also becomes a table.

如何避免这种情况?

我的CSS中包含以下内容:

I have the following in my CSS:

table.table {
    tr {
        th {
            color: #ff0000;  //red
        }
     }
  }

这是我的html文件:

This is my html file:

<table class="table">
    <tr>
      <th>Reconcile Date</th>
    </tr>
    <tr>
      <td>
        <div class="pickdate">
          <input type="text" placeholder="Reconcile Date" class="form-control ">
        </div>
      </td>
    </tr>
</table>

这会将表格标题中的文本设置为红色.它还 将我的日期选择器中星期几和月份的名称设置为红色.注意pickdate类加载了datepicker

This sets the text in my table header to red. It also sets the days of the week and month name in my datepicker to red. Note the pickdate class load the datepicker

推荐答案

使用Google Chrome浏览器的检查工具,我能够在datepicker表上找到其中一个类,并在该级别添加CSS.这是CSS和jsfiddle链接:

By using Google Chrome's inspection tools I was able to find one of the classes on your datepicker table and add the CSS at that level. Here is the CSS and jsfiddle link:

 .table tr th{ color: red; }

 .table-condensed thead tr th{ color: black;}

https://jsfiddle.net/w8gmcgv4/5/

让我知道这些方法是否对您有用.谢谢!

let me know if these work for you. Thanks!

这篇关于日期时间选择器从我的表继承样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆