How make text-decoration: underline with 2px padding?

后端 未结 10 2346
無奈伤痛
無奈伤痛 2021-02-07 02:19

I like an obedient frotend developer must create underline with 2px padding instead of 1px by default. Is exist simple solution for this?

PS Yeahh guys, I know about div

10条回答
  •  抹茶落季
    2021-02-07 02:41

    This is my solution...

    HTML

    hola dasf hola dasdsaddasds dsadasdd

    CSS

    p {
      color: red;
      text-decoration: none;
      position: absolute;
    }
    a:hover {
        color: blue;
    }
    p span {
        display:block;
        border-bottom:3px solid black;
        width: 50%;
        padding-bottom: 4px;
    }
    

提交回复
热议问题