Open In App

How to write sample output of a computer program using HTML5 ?

Last Updated : 03 Jun, 2020
Improve
Improve
Like Article
Like
Save
Share
Report

In this article, we will write the sample output of a computer program by using a <samp> tag in the document. It is a phrase tag and used to define the sample output text from a computer program.

Syntax:

<samp> Contents... </samp>

Example:




<!DOCTYPE html>
<html>
  
<head>
    <title>
        Define sample output
        from a computer program
    </title>
  
    <style>
        body {
            text-align: center;
        }
  
        .gfg {
            font-size: 40px;
            font-weight: bold;
            color: green;
        }
  
        .geeks {
            font-size: 25px;
            font-weight: bold;
        }
    </style>
</head>
  
<body>
    <div class="gfg">
        GeeksForGeeks
    </div>
  
    <div class="geeks">
        HTML5: How to define sample
        output from a computer program?
    </div>
  
    <samp>
        A computer science
        portal for Geeks
    </samp>
</body>
  
</html>             


Output:

Supported Browsers:

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


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads