Edit line thickness of CSS 'underline' attribute

前端 未结 11 652
日久生厌
日久生厌 2020-12-02 07:35

Since you can underline any text in CSS like so:

h4 {
    text-decoration: underline;
}

How can you also then edit the \'line\' that is drawn

11条回答
  •  借酒劲吻你
    2020-12-02 08:19

    Thanks to the magic of new css options this is now possible natively:

    a {
      text-decoration: underline;
      text-decoration-thickness: 5px;
      text-decoration-skip-ink: auto;
      text-underline-offset: 3px;
    }
    

    As of yet support is relatively poor. But it'll land in other browsers than ff eventually.

提交回复
热议问题