Code has been added to clipboard!

Using samp HTML Tag

Reading time 1 min
Published Jun 29, 2017
Updated Sep 11, 2019

samp HTML: Main Tips

  • The <samp> tags define the HTML sample element.
  • You should use it to convey that some inline text represents output from a computer script.
  • HTML samp tag doesn't have any specific attributes, but supports global attributes in HTML.
  • You cannot omit the ending tag.

Using <samp> Tags

HTML <samp> tags surround inline text that represents computer output:

Example
<samp>Sample tag output from a computer application.</samp>

That's why it's commonly used for technical documentation to specify the output (i.e. an error message).

You can also use samp HTML tag together with kbd tag to specify that the computer outputs the text which was entered by a user (i.e. to show how terminal messages in Linux, macOS or Windows might look) or to represent the onscreen input options. You can read more about it here.

For the styling of HTML sample element, most browsers choose their default monospaced font (i.e., Courier).

Udacity
Pros
  • Simplistic design (no unnecessary information)
  • High-quality courses (even the free ones)
  • Variety of features
Main Features
  • Nanodegree programs
  • Suitable for enterprises
  • Paid certificates of completion
Coursera
Pros
  • Professional service
  • Flexible timetables
  • A variety of features to choose from
Main Features
  • Professional certificates of completion
  • University-level courses
  • Multiple Online degree programs
Datacamp
Pros
  • Great user experience
  • Offers quality content
  • Very transparent with their pricing
Main Features
  • Free certificates of completion
  • Focused on data science skills
  • Flexible learning timetable

Default CSS Settings

Most browsers use these settings by default for code in samp HTML tags:

Example
samp { 
    font-family: monospace;
}

Tip: learn to add additional CSS modifications in the CSS fonts tutorial.

Browser Support

Browser image
Chrome
All
Browser image
Edge
All
Browser image
Firefox
1+
Browser image
IE
All
Browser image
Opera
All
Browser image
Safari
All

Mobile Browser Support

Browser image
Chrome
All
Browser image
Firefox
4+
Browser image
Opera
All
Browser image
Safari
All

Latest Udacity Coupon Found:

Verified STAFF PICK

75% OFF COURSES

Udacity Black Friday Offer

The best time to save on Udacity courses is now - follow this coupon to access a 75% Udacity Black Friday discount & enjoy learning at a very low cost!

Expiration date: 27/02/2021
3176 People Used
Only 97 Left
Rating
5.0