Related Articles

Related Articles

HTML | <del> Tag
  • Difficulty Level : Basic
  • Last Updated : 17 Jul, 2019

The <del> tag in HTML stands for delete and is used to mark a portion of text which has been deleted from the document. The deleted text is rendered as strikethrough text by the web browsers although this property can be changed using CSS text-decoration property. The <del> tag requires a starting and ending tag.

Syntax:

<del> Contents... </del>

Attributes: The <del> tag contains two attributes which are listed below:

  • cite: It is used to specify the URL of the document or message which denotes the reason of deleting the text.
  • datetime: It is used to specify the date and time of the deleted text.

Below programs illustrate the <del> element in HTML:

Example 1:



filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
    <head>
        <title>del Tag</title>
        <style>
            del{
                color: red;
            }
            ins{
                color: green;
            }
            h1 {
                color:green;
            }
            body {
                text-align:center;
            }
        </style
    </head>
    <body>
        <h1>GeeksforGeeks</h1>
        <h2><del> Tag</h2>
        <p>GeeksforGeeks is a <del>mathematical</del>
        <ins>computer</ins> science portal</p
    </body>
</html>                    

chevron_right


Output:

Example 2: This example use the <del> tag with the datetime attribute.
Input:

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
    <head>
        <title>del Tag</title>
        <style>
            del{
                color: red;
            }
            ins{
                color: green;
            }
            h1 {
                color:green;
            }
            body {
                text-align:center;
            }
        </style
    </head>
    <body>
        <h1>GeeksforGeeks</h1>
        <h2><del> Tag</h2>
        <p>GeeksforGeeks is a 
         <del datetime="2018-11-21T15:55:03Z">mathematical</del
         <ins>computer</ins>
         science portal</p>
    </body>
</html>                    

chevron_right


Output:

Supported Browsers: The browser supported by <del> tag are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari

full-stack-img




My Personal Notes arrow_drop_up
Recommended Articles
Page :