Home > Software design >  How to style this type of class?
How to style this type of class?

Time:08-10

I have something like this:

<i >

It's a mark for check-sign. In a course that I'm doing the teacher had at that time just . We were supposed to style it, to change the color, and I don't know how to do it.

I tried:

.plan li.fa-solid.fa-check

.plan li.fa-solid .fa-check

.fa-solid.fa-check

In the end, I just put style to the line and it worked but I know that this is not the recommended approach.

CodePudding user response:

First, what you trying is called css selector Reference

Check the reference, it might help you get to sleep.

Suggestion: You haven't need to select specifically to your target element. If you working on simple project, just only your class's name. It's fine enough.

.fa-solid {
    color: red;
}

CodePudding user response:

These icons come from the Font awesome icons library, and are styled in css. You'll want to identify the icon that you want to change the color of (ID and Class are useful for this) then add in a CSS rule for that designator.

This can be done on the same page, or in a separate stylesheet depending on what you are doing. Have at look at this link to learn more about how you can add color, size and other attributes to things in CSS. Understanding this concept early will be a great help to you in the future.

https://www.w3schools.com/css/css_howto.asp

Also more information on the Font Awesome Icons:

https://www.infradox.com/working-with-font-awesome-icons/

CodePudding user response:

Hi bro can u try this Method.

" rel="nofollow noreferrer">

this is the fontawesome cdn link. u can use and link in your html head tag.

next use this icon it will 100% definitely works so try This....

  • Related