skip to Main Content

I am using ngx-pagination in Angular 16 application and I want to customize the default blue color into another , Can anyone help me.

enter image description here

Html code:

<div>
  <pagination-controls (pageChange)="getPagedItems($event)"></pagination-controls>                       
</div>

CSS

.ngx-pagination .current{
  color: #ffffff !important;
  background-color: red !important;
}

Tried with above and similar css, it do not works.

Any help will be appreciated.

2

Answers


  1. Chosen as BEST ANSWER

    It worked after below changes.

    HTML

    <pagination-controls class="my-pagination"><pagination-controls>
    

    CSS

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

  2. Try these changes ,

    /* Change the background color of the current page */
    .pagination-current {
      background-color: red !important;
    }
    
    /* Change the text color of the current page */
    .pagination-current a {
      color: #ffffff !important;
    }
    
    /* Change the background color of the page buttons */
    .pagination-controls button {
      background-color: red !important;
    }

    If it is not working means , I want to Inspect your line of code further more

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search