简体   繁体   中英

Angular Material Date Picker Size

I've been trying to use the Material Datepicker, but when I come to large screens the picker format blows up (see image). How do I limit the size of the picker container as it works correctly when the screen is set to smaller sizes. It makes sense to set it so it never gets larger than a given number of pixels but I can't work out/find the CSS tags to do this. 这是我屏幕的整个宽度

My HTML of the picker is copied from the demo:

 <md-content layout-padding>
    <div layout-gt-xs="row">
      <div flex-gt-xs>
        <h4>Standard date-picker</h4>
        <md-datepicker ng-model="myDate" md-placeholder="Enter date"></md-datepicker>
      </div>
    </div>
    </md-content>

Trying this CSS yields no results

.md-datepicker-input-container {
  width: 50%;
  margin-left: 0px;
}

I have run into to this issue.

Somewhere in my css all tables' width was set to 100%

table {
    width:100%;
}

When I removed that, the md-datepicker stopped acting weird.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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