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

王林
Release: 2023-08-29 16:17:03
forward
951 people have browsed it

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> <div class="code" style="position:relative; padding:0px; margin:0px;"><pre class='brush:php;toolbar:false;'><samp>The text…</samp>

Copy after login
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>
Copy after login
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>
Copy after login

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>
Copy after login

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!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!