CSS - Multiple text-decorations with style and color

前端 未结 4 1774
悲哀的现实
悲哀的现实 2021-01-19 18:14

I want to make a text with red wavy underline and blue dashed overline using text-decoration.
This is my code: (working only in Mo

4条回答
  •  一整个雨季
    2021-01-19 18:20

    You can not have two values for one css property at the same time.

    Workaround: wrap yout text in another span and add separate text-decoration to each span:

    span {
      font-size: 40px;
    }
    
    .wavy {
      text-decoration: underline wavy red;
    }
    
    .dashed {
      text-decoration: overline dashed blue;
    }
    
      Some Text 
    

提交回复
热议问题