-1

No matter I tried the following codes, the background-color still not works. Is there any way to change it?

The package I installed: https://developer.aliyun.com/mirror/npm/package/ng-marquee/v/1.0.1

<ng-marquee [stopOnHover]="true" duration="40s" direction="alternate" bgcolor="#212529" > Test </ng-marquee>

or

Component:

<ng-marquee [stopOnHover]="true" duration="40s" direction="alternate" class="Color"> Test </ng-marquee>

CSS:

.Color { background-color: #212529; }
W Kenny
  • 1,855
  • 22
  • 33

2 Answers2

1

in order for your css to effect inner libraries you'll probably have to use the ::ng-deep selector.

What to use in place of ::ng-deep

How and where to use ::ng-deep?

JBoothUA
  • 3,040
  • 3
  • 17
  • 46
1

Thanks to @JBoothUA reply. ::ng-deep is the solve

Component:

<ng-marquee [stopOnHover]="true" duration="40s" direction="alternate" class="marquee">
    Test
</ng-marquee>

CSS:

.marquee { 
    ::ng-deep {
        .ng-marquee {
            background-color: #292059; 
            color: white;
        }
    }
}
W Kenny
  • 1,855
  • 22
  • 33