UI UX Design (36 Blogs) Become a Certified Professional

Know How to implement pre tag in HTML

Last updated on May 24,2023 856 Views


The <pre> tag in HTML is used for identifying preformatted text. The code tag is surrounded by the code being marked up. Let’s understand this

 

What is the use of pre tag in HTML?

In your web browsers usually render pretext in a fixed-pitched font, with the whitespace intact, and without the word wrap.

html-spanIn this, the pre tag will allow the same space and the font with respect to the user entered. The below mentioned is the specific attributes in which the pre tag in HTML will support in the table mentioned.

 

Specific Attributes and Browser Support

This HTML <pre> tag will also support the following additional attributes:

  • Width

Value: Number

Description: This one specifies the required width of the pre-formatted content.

 

Browser Supports

Here listing out all the browsers which are supporting. It’s given it the table mentioned below. So if you have any of these it will support.

ChromeIE OperaSafariAndroidFirefox
YESYESYESYESYESYES

 

Examples of <pre> tag

Example 1:

<!DOCTYPE html>
<html>
		<head>
			<title> pre tag in HTML</title>
		</head>
		<body>
		

<pre>
			This is the content     writing
			    for the HTML     pre tag.
		Includes the          code  here.
		</body>
</html>

Output:

pre tag in html

 

Example 2:

<!DOCTYPE html>
<html>
		<head>
			<title> pre tag in HTML</title>
		</head>
		<body>
		
<pre>
			I'm working for           edureka
			Writing         blogs     on the        programming 
			                 language
		</body>
</html>

Output:

example of pre tag

 

With this, we come to an end of this article on pre tag in HTML. I hope you got an idea on how to preformat a text in HTML with these examples. DO check our other blogs on HTML.

Transform your designs and boost your career with our UI UX Design Course.

Check out our Full Stack Web Developer Masters Program which comes with instructor-led live training and real-life project experience. This training makes you proficient in skills to work with back-end and front-end web technologies. It includes training on Web Development, jQuery, Angular, NodeJS, ExpressJS, and MongoDB.

Check out the Angular Online Course by Edureka, a trusted online learning company with a network of more than 250,000 satisfied learners spread across the globe. Angular is a JavaScript framework that is used to create scalable, enterprise, and performance client-side web applications. With Angular framework adoption being high, performance management of the application is community-driven indirectly driving better job opportunities.

Upcoming Batches For UI UX Design Certification Course
Course NameDateDetails
UI UX Design Certification Course

Class Starts on 27th April,2024

27th April

SAT&SUN (Weekend Batch)
View Details
UI UX Design Certification Course

Class Starts on 22nd June,2024

22nd June

SAT&SUN (Weekend Batch)
View Details
Comments
0 Comments

Join the discussion

Browse Categories

webinar REGISTER FOR FREE WEBINAR
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP

Subscribe to our Newsletter, and get personalized recommendations.

image not found!
image not found!

Know How to implement pre tag in HTML

edureka.co