我想让 toastr 的弹出窗口看起来与 Bootstrap 警报相同或非常接近。我怎样才能做到这一点?
最佳答案
包括 Bootstrap 警报的 CSS,然后在您的 toastr 选项中,更改 toastClass 和 iconClasses 的值:
toastr.options = {
toastClass: 'alert',
iconClasses: {
error: 'alert-error',
info: 'alert-info',
success: 'alert-success',
warning: 'alert-warning'
}
},
然后在 toastr 的 CSS 中,从
#toast-container > div
中删除阴影。所以它最终看起来像:#toast-container > div {
width: 300px;
}
如果需要,您可以保留填充,或者将其添加到您自己的 CSS 文件中,而不是编辑 toastr(最好是确保之后加载您的)。
关于twitter-bootstrap - 使 toastr 警报看起来像 Bootstrap 警报,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15066882/