- 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
How to mark strikethrough text in HTML?
To mark strikethrough text in HTML, use the <strike>…</strike> tag. It renders a strikethrough text. HTML deprecated this tag and it shouldn’t be used in HTML5. As an alternative, use the CSS text-decoration property.
To use the CSS property, use the style attribute. The style attribute specifies an inline style for an element. The attribute can be used with the HTML <p> tag. Just keep in mind, HTML5 does not support the <strike> tag, so the CSS style should be used.
Example
You can try to run the following code to mark strikethrough text in HTML
<!DOCTYPE html> <html> <head> <title>HTML Strikethrough text</title> </head> <body> <h1>Heading</h1> <p style="text-decoration: line-through;"> Strikethrough text </p> </body> </html>
Output
Advertisements