简体   繁体   English

Bootstrap Datepicker在小浏览器屏幕上调整位置和大小

[英]Bootstrap datepicker adjust position and size on small browser screen

My Bootstrap datepicker currently displays at the bottom left of the textbox, thats ok in a normal browser window. 我的Bootstrap日期选择器当前显示在文本框的左下方,在正常的浏览器窗口中可以。 But the issue comes when the browser window is made small or resized. 但是问题出在浏览器窗口变小或调整大小时。 I want to make the datepicker display top left when the browser window is made small . 当浏览器窗口变小时,我想使日期选择器显示在左上方。 Also on small screen I want the datepicker to become small also , but it should be readable and should also look good 同样在小屏幕上,我希望日期选择器也变小,但是它应该可读并且看起来也不错

Any help would be greatly appreciated 任何帮助将不胜感激

You want to use CSS media queries for different resolutions. 您想要对不同的分辨率使用CSS媒体查询。 eg. 例如。

@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);
    }
}

more: w3schools/mediaqueries 更多: w3schools / mediaqueries

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM