::first-letter pseudo-element not working in firefox

前端 未结 3 1601

I cannot for the life of me figure this one out. I just want to style the dollar sign to be a different color and I would like to avoid using another element around the dol

3条回答
  •  感情败类
    2021-01-14 06:42

    Others already explained why it doesn't work, so, a small fix for you to consider: give your money div a class, eg

  • David Wilcox
    5,849,48784
  • take out the literal $, and put it in :before content, eg:

    .money:before {
        content: '$';
        ...
    }
    

    Now you can style it however you like.

提交回复
热议问题