简体   繁体   English

使用“ngx-pagination”的默认样式不会覆盖角度样式 css

[英]Angular style css not overwritten by default style using 'ngx-pagination'

I'm currently using the 'ngx-pagination' module from Michael Bromley.我目前正在使用 Michael Bromley 的“ngx-pagination”模块。 The module is working fine, but it seems to be the only pagination module that doesn't use the existing theme css.该模块工作正常,但它似乎是唯一不使用现有主题 css 的分页模块。 Now it looks like:现在它看起来像:

在此处输入图片说明

Reading his explanation , it seems that it should be easy by simply override the css by adding /deep/ .阅读他的解释,似乎通过添加/deep/来简单地覆盖 css 应该很容易。 Well, it doesn't work... Some people say it's 'deprecated' , so I've tried adding !important , but that doesn't seem to work as well.好吧,它不起作用……有人说它已“弃用” ,所以我尝试添加!important ,但这似乎不起作用。

See -> https://stackblitz.com/edit/angular-p3swdg见 -> https://stackblitz.com/edit/angular-p3swdg

In the 'app.component.css' I've uploaded the theme css and in the end it should look like (see documentation ):“app.component.css”中,我上传了主题 css,最后它应该是这样的(参见文档):

在此处输入图片说明

Any help would be appreciated.任何帮助,将不胜感激。

Here is quick working stackblitz solution .这是快速工作的stackblitz 解决方案

.pagination /deep/ .ngx-pagination .current {
    background: red;
  }

  .pagination /deep/ .ngx-pagination li {
    border: 1px solid #CCCC;
    margin-right: 0px;
  }

   .pagination /deep/ .ngx-pagination a::after{
     display: none;
   }

   .pagination /deep/ .ngx-pagination li::before{
     display: none;
   }

    .pagination /deep/ .ngx-pagination li::after{
     display: none;
   }

    .pagination /deep/ .ngx-pagination a::before{
     display: none;
   }

using /deep .使用/deep You can polish the css better but you'll get the idea from this.你可以更好地润色 css,但你会从中得到想法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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