Web Analytics Made Easy -
StatCounter How do you do a strikethrough tag? - CodingForum

Announcement

Collapse
No announcement yet.

How do you do a strikethrough tag?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How do you do a strikethrough tag?

    how do you do a cross-out or strikethrough in HTML? like so that the text has a line through it?
    ~KGP

  • #2
    Using CSS you could do it like:
    Code:
    p.lined {
        text-decoration:line-through;
    }
    And use it like:

    Code:
    <p class="lined">This text has a line through it.</p>
    <p>This doesn't</p>

    Comment


    • #3
      the <s> tag will do it actually. It's an inline tag so use it in the same way was <b> or <i>

      EDIT: It's been depreciated as of the latest browser specs, so i would do something similar to the posta above, except using an inline tag instead of <p> :

      Code:
      <style type="text/css">
      .strike {
      text-decoration: line-through;
      }
      </style>
      
      <p><span class="strike">Striken out</span> normal text.</p>
      Last edited by ReadMe.txt; Mar 3, 2004, 10:00 AM.
      "To be successful in IT you don't need to know everything - just where to find it in under 30 seconds"

      (Me Me Me Me Me Me Me Me Me)

      Comment

      Working...
      X