- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Display strikethrough text in HTML
Strikethrough text means line through text, <strike> tag helps us to cut line in the text. This tag is not supported in HTML5; it was used when everyone working on HTML4. Now instead of <strike> tag <del> tag is using in HTML5 to define deleted text.
Syntax
Following is the usage of strikethrough tag in HTML −
<strike>text…. </strike>
Example
In the following example we are trying to display a strike through a text using the <strike> tag –
<!DOCTYPE html> <html> <body> <h2>TutorialsPoint</h2> <p>Its an Edutech Company handles all Technical <strike>Non-Technical</strike> Subjects </p> </body> </html>
Example
In this example we are trying to achieve the strike through task using the <del> tag −
<!DOCTYPE html> <html> <head> <style> del { color: red; } </style> </head> <body> <h1>My World</h1> <h2> I Like Blue , <del>Red</del>, Pink colors </h2> </body> </html>
Example
We can also use <ins> tag to highlight by underlining the text. Following example demonstrate the usage of <ins> tag in HTML
<!DOCTYPE html> <html> <head> <style> h1 { color: red; } </style> </head> <body> <h1>My World</h1> <h2> I Like Orange , <del>blue</del> <ins>red</ins>, Pink colors! </h2> </body> </html>
Example
Following is another example, to know about markup text which is no longer correct −
<!DOCTYPE html> <html> <head> <style> h1{ color: red; } </style> </head> <body> <h1>My World</h1> <h2><s>I Like red, black colors!</s></h2> <h2>But Everyone likes Pleasant colors</h2> </body> </html>
Advertisements