Open In App

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

Last Updated : 19 Jun, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

To write the sample output of a computer program using HTML5, utilize the <samp> tag. This tag is a phrase tag specifically designed to represent sample output from a computer program, ensuring the text is appropriately styled and semantically meaningful.

Syntax:

<samp> Contents... </samp>

Example: The example below shows how to write sample output of a computer program using <samp> tag.

html
<!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="geeks">
        How to define sample
        output from a computer
        program
    </div>

    <samp>
        A computer science
        portal for Geeks
    </samp>
</body>

</html>

Output:

sampt
Output

Next Article

Similar Reads