【问题标题】:Bootstrap-datepicker background-color issue with active dates带有活动日期的 Bootstrap-datepicker 背景颜色问题
【发布时间】:2016-09-20 10:01:53
【问题描述】:

我正在使用Bootstrap datepicker,我希望活动日期是圆形的。我目前在 td 上使用border-radius: 50% 和活动日期,但这会导致问题,因为我希望日期表是斑马条纹

table > tbody > tr:nth-of-type(odd) {
  background-color: #eee;
}

table > tbody > tr:nth-of-type(even) {
  background-color: #e2e2e2;
}

jsFiddle example here

如您所见,圆形日期背后的背景显然是可见的。

知道如何解决这个问题吗?也许通过让日期被包裹在每个 td 内的跨度中,或者使用一些 css 修复?

【问题讨论】:

  • 你能在switch case javascript中添加额外的html代码吗??
  • 我无法在文档中找到任何关于它的内容 - 所以我不知道。

标签: css bootstrap-datepicker


【解决方案1】:

看到基本上你是在td 中更改 border & background-color 然后白色背景色显示。这个场景所有的表都是生成的。看下面的简单例子

看小例子

table, th, td {
    border: 1px solid black;
}
.active
{
   background-color: green;
   border-radius: 50%;
 }
<table>
  <tr bgcolor="#c2c2c2">
    <th class="active">Month</th>
    <th>Savings</th>
  </tr>
  <tr>
    <td>January</td>
    <td>$100</td>
  </tr>
</table>

那么我认为最好的解决方案是你可以设置Table background-color 和您需要的更改 tr 颜色。那么您无法获取此问题。

小提琴演示 Here

【讨论】:

  • 它仍然不完全存在 - 从您的演示中结帐 9 月 12 日。它仍然在活动日期后面显示另一种背景颜色。
  • 我知道。在演示中不要删除您的旧样式和事件样式。我已经删除了旧的和事件样式点击jsfiddle.net/co4v559s/2
猜你喜欢
  • 2014-07-23
  • 2013-04-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-10-24
  • 2015-05-09
  • 2020-03-06
  • 1970-01-01
相关资源
最近更新 更多