How to Double Strikeout a Text in HTML?

前端 未结 9 681
一向
一向 2021-02-07 04:26

I know about , and tags. These tags strike out a text once, however I want to strike out a text 2 time

9条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-07 05:12

    You can do it... why you want two strike-throughs instead of one sounds like the demands of a pointy haired boss who "isn't crazy about the font". It is possible to hack in a solution.

    Here is the html

    This is my text with 
    two lines through it
    in a paragraph because of crazy weird
    requirements

    Now the CSS

    span.double-strike {
      position: relative;
    }
    
    span.double-strike div.the-lines {
       position: absolute;
       top: 10px; /* Depends on the font size */
       left: 0;
       border-top: 3px double black;
       width: 100%;
       height: 100%;
    }
    

    ALSO, make sure you are running in strict mode, or else you will have a few issues in IE.

    Here's a jsfiddle of the example

提交回复
热议问题