【发布时间】:2019-12-13 05:28:31
【问题描述】:
嗨,我正在使用 typescript 在 angular 6 中实现 Ngx-toastr,我的问题是我无法按照我的意愿让它变得漂亮,因为我不知道哪个 css 被覆盖在那个 ngx-toastr 类我在 Style.css 文件 ngx-toastr 上写了一些 css,我想要 border-radius: 15px; 但内部部分没有使用 border-radius: 15px; 进行圆角我搜索了很多资源来自互联网,但没有得到正确的输出,我无法更改其他 toastr 因为在我的项目中,大约 350+ 组件 我不想使用方法更改每个文件,这就是我想要自定义的原因现有的 toastr CSS。
这是我的 CSS 代码
.toast-container .ngx-toastr {
position: relative;
overflow: hidden;
margin: 0 0 6px;
padding: 15px 15px 15px 50px;
width: 300px;
border-radius: 15px !important;
background-position: 15px center;
background-repeat: no-repeat;
background-size: 24px;
box-shadow: 0 0 12px #999;
color: #fff;
border-image-source: linerar-gradient(red,purple) !important;
border: 4px solid green !important;
border-image-source: linear-gradient(red, purple) !important;
border-image-slice: 20 !important;
}
.toast-success {
background-color: #51a351;
}
但我的期望是,如果您想检查,我希望与这张图片中的相同,然后访问此链接并单击 RESET 按钮以显示 toastr Click Here to visit that site
这是我的StackBlitz Code
【问题讨论】:
-
你能不能把边框改成 2px 纯红色 !important,看看这是不是你想要的。
-
不,我想要一些更圆的角,比如
border-radius: 15px; -
是的,它还在。将边框半径保持为 15px,但只需更改边框粗细和颜色
-
但是你可以检查内部不是圆形的仍然有角我想要内部也是边界半径
标签: angular typescript notifications ngx-toastr