CSS is not working in my angular component

后端 未结 3 567
一整个雨季
一整个雨季 2021-02-01 15:28

I am trying to make a simple Angular4 web app that will show and X or O depending on what the rating is. I do not see the X or O in my web app.

The CSS classes in my rat

3条回答
  •  一向
    一向 (楼主)
    2021-02-01 15:51

    If you do not want to mess with ViewEncapsulation and still have the styles isolation, you can define the style within your global css file (e.g. styles.scss) by prefixing the component selector:

    rating .star.star-full-icon{
        content:'X';
    }
    

    This was tested in an Angular 10 web application.

提交回复
热议问题