【问题标题】:How to change direction of bootstrap datepicker如何更改引导日期选择器的方向
【发布时间】:2013-08-19 05:58:20
【问题描述】:

所以我必须在 300 X 250 的一个非常短的地方为字段添加日期。日期有两个输入字段。我想要一个具有正常方向的日期选择器,而另一个应该指向文本字段的右侧。

所以我想在第一个文本字段中使用这个:

这是第二个:

【问题讨论】:

  • 考虑添加一个自定义参数来控制它。
  • @Itay,好吧,太棒了,如何为这些东西更改 css?
  • 你有没有试过用浏览器的检查器检查它,看看它是如何定位的,并了解如何自己定位它?

标签: twitter-bootstrap datepicker


【解决方案1】:

我认为引导程序中没有直接选项,但这可以通过 CSS hack 来完成。

覆盖现有的:before:after 伪元素。

.datepicker:before {
content: '';
display: inline-block;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
border-bottom: 7px solid #ccc;
border-bottom-color: rgba(0, 0, 0, 0.2);
position: absolute;
top: -7px;
left: 190px;  // I made a change here 
}

.datepicker:after {
content: '';
display: inline-block;
border-left: 6px solid transparent;
border-right: 6px solid transparent;
border-bottom: 6px solid #ffffff;
position: absolute;
top: -6px;
left: 191px;  // I made a change here 
}

查看JSFiddle

【讨论】:

  • 该死,自己想办法,回来发表答案,然后....我迟到了 38 秒!无论如何......你是对的!点,点,点
  • @JackieChan 很高兴为您提供帮助。它通常发生在这里:)
  • @JackieChan 你应该接受这个带有绿色“V”标志的答案。
  • 你应该知道我只能在提交问题10或8分钟后才能接受答案...
  • 完成!但是我遇到了另一个问题stackoverflow.com/questions/18307610/…
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2019-08-23
  • 1970-01-01
  • 2013-12-14
  • 2013-11-28
  • 1970-01-01
  • 2017-12-23
  • 1970-01-01
相关资源
最近更新 更多