如何更改 ngx bootstrap 模态宽度?

新手上路,请多包涵

如何将宽度设置为我的 ngx 引导模式,我已经尝试过,但就像它是固定的?

这是html

     <div bsModal #childModal="bs-modal" class="modal fade" tabindex="-1"
     role="dialog" [config]="{backdrop: 'static'}" aria-hidden="true">
    <div class="modal-dialog modal-sm">
    <div class="modal-content">
        <div class="modal-body text-center">
            <button type="button" class="close" data-dismiss="modal" aria-
    label="Close" (click)="hide()"><span aria-hidden="true">&times;</span>
     </button>
            <h4 class="modal-title" id="myModalLabel">Are you sure?</h4>
            <div class="modal-footer">
                <div class="col-xs-6 no-padding-left">
                    <button type="button" id="dialog_no" class="btn btn-
        default btn-block" data-dismiss="modal" (click)="hide()">No</button>
                </div>
                <div class="col-xs-6 no-padding-right">
                    <button type="button" id="dialog_yes" class="btn btn-
     primary btn-block ladda-button" data-style="expand-right"
     (click)="confirm()">Yes</button>
                </div>
            </div>
        </div>
    </div>
     </div>
  </div>

如何设置模态框的宽度,以便将按钮放置在模态框的边缘,让我们说 5 px 的边框边距?

模态引导

我还没有在我的css文件中添加任何样式,即使我尝试修改宽度但我猜不知道如何……

原文由 code_newbie23 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 551
1 个回答

使用集合类

let modal = this.bsModalService.show(ConfirmModalComponent, {
         initialState: { message: 'คุณแน่ใจหรือไม่ว่าจะลบข้อมูล Voucher นี้?' },});

modal.setClass('modal-custom-style');

和自定义 CSS

::ng-deep .modal-custom-style { max-width: 1200px!important; width: 1200px; }

原文由 Jaroon Umpornpoolsuk 发布,翻译遵循 CC BY-SA 4.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题