【问题标题】:Bootstrap datepicker adjust position and size on small browser screenBootstrap datepicker 在小浏览器屏幕上调整位置和大小
【发布时间】:2023-03-11 09:17:01
【问题描述】:

我的 Bootstrap 日期选择器当前显示在文本框的左下方,在普通浏览器窗口中没问题。但是当浏览器窗口变小或调整大小时,问题就出现了。当浏览器窗口变小时,我想让日期选择器显示在左上方。同样在小屏幕上,我希望日期选择器也变小,但它应该是可读的并且应该看起来不错

任何帮助将不胜感激

【问题讨论】:

  • orientation: 'auto' 应该这样做bootstrap-datepicker.readthedocs.io/en/latest/…
  • 我们已经有了方向:“底部自动”,但它不起作用。日期选择器在引导模式中。当缩小尺寸时,它会从底部切断日期选择器

标签: javascript jquery twitter-bootstrap bootstrap-datepicker


【解决方案1】:

您想针对不同的分辨率使用 CSS 媒体查询。例如。

@media (min-width: 768px) {
    .some-class {
        float: right;
        width: some_width;
        height: auto;
    }     
}

@media (min-width: 481px) and (max-width: 767px) {
    .some-class {
        float: left;
        width: some_smaller_width;
        height: auto (or some specific height);
    }
}

更多:w3schools/mediaqueries

【讨论】:

  • 请大家帮忙
猜你喜欢
  • 1970-01-01
  • 2020-04-30
  • 1970-01-01
  • 2013-10-11
  • 2012-01-28
  • 1970-01-01
  • 2022-01-26
  • 2017-08-08
  • 1970-01-01
相关资源
最近更新 更多