我怎样才能在ngDialog中设置对话框宽度
我只是试图设置对话框的宽度,我还没有成功(但)。我已经添加了一个CSS类,但宽度集是对话框中的一个阴影。我怎样才能在ngDialog中设置对话框宽度
.dialogwidth800 {
width : 800px;
}
...
ngDialog.openConfirm({
template: 'templateRemove',
className: 'ngdialog-theme-default dialogwidth800',
scope: $scope
}).then(
编辑:拨弄着在这里工作的解决方案更正:https://jsfiddle.net/jr626fww/8/
应用与.ngdialog-content{width :100px !important;}
使用类宽度重要的是非常重要的,覆盖任何CSS属性
使用“!important”至少在需要时使用,并且无法编辑课程。但是,这一次,您可以通过将类添加到主类来获得结果:.ngdialog.dialogwidth800 .ngdialog-content {...} –
此解决方案影响所有ngDialogs。 @BharatBhushan – betomoretti
它可以很容易地通过使用自定义的CSS一样实现如下:
.ngdialog.ngdialog-theme-default.custom-width-800 .ngdialog-content {
width: 800px;
}
.ngdialog.ngdialog-theme-default.custom-width-900 .ngdialog-content {
width: 900px;
}
打开时使用这些css类ngDialog:
要使用定制宽度900
ngDialog.openConfirm({
template: 'templateRemove',
className: 'ngdialog-theme-default custom-width-800',
scope: $scope
});
要使用定制宽度900
ngDialog.openConfirm({
template: 'templateRemove',
className: 'ngdialog-theme-default custom-width-900',
scope: $scope
});
的模式内容的类名是** ngdialog内容* * CSS:.ngdialog.dialogwidth800 .ngdialog-content {width:800px;} –
@wZVang是对的,将width应用于类.ngdialog-content。 – Konammagari
非常感谢,我使用了@wZVanG解决方案,并且我编辑了小提琴。 – GuillaumeS