Home  >  Article  >  Web Front-end  >  How can we use the `

` tag in HTML for computer output formatting?

How can we use the `
` tag in HTML for computer output formatting?

王林
王林forward
2023-08-29 16:17:031017browse

How can we use the `<pre class=` tag in HTML for computer output formatting?"></p> <p>We use the <b><samp></samp></b> tag for computer output formatting. It is a phrase tag. It is used to define and identify the sample output of a computer program. It will display the text within the <samp> element in a single font. </samp></p> <h2>grammar</h2> <pre class='brush:php;toolbar:false;'><samp>The text…</samp> The Chinese translation of

Example 1

is:

Example 1

The following is a simple example to explain the usage of tag in HTML -

<html>
<head>
   <meta charset="UTF-8">
   <meta name="description" content="meta tag in the web document">
   <meta name="keywords" content="HTML,CSS">
   <meta name="author" content="lokesh">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
   <p><b>Pluralsight</b> is the technology workforce development company that helps teams know more and work better together with stronger skills, improved processes</p>
   <samp>
      Pluralsight, Inc. is an American privately held online education company that offers a variety of video training courses for software developers
   </samp>
</body>
</html>
The Chinese translation of

Example 2

is:

Example 2

Another example of using this tag in an HTML document is −

<html>
<head>
   <title>Title of the document</title>
</head>
<body>
   <samp>
      <h2> HTML document</h2>
      <p>This is a paragraph.</p>
      <p>This is another paragraph</p>
   </samp>
</body>
</html>

Example 3

is translated as:

Example 3

We can override font styles using style sheets.

<html>
<head>
   <meta charset="UTF-8">
   <meta name="description" content="meta tag in the web document">
   <meta name="keywords" content="HTML,CSS">
   <meta name="author" content="lokesh">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <style>
      samp{
         font-family: cursive;
      }
   </style>
</head>
<body>
   <p><b>Pluralsight</b> is the technology workforce development company that helps teams know more and work better together with stronger skills, improved processes</p>
   <samp>
      Pluralsight, Inc. is an American privately held online education company that offers a variety of video training courses for software developers
   </samp>
</body>
</html>

The above is the detailed content of How can we use the `

` tag in HTML for computer output formatting?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete