PRE tag in html AR3school

 What are the attributes of pre-tag?


The <pre> tag in HTML is used to define the block of preformatted text which preserves the text spaces, line breaks, tabs, and other formatting characters which are ignored by web browsers. Text in the <pre> element is displayed in a fixed-width font, but it can be changed using CSS.


What are the attributes of pre-tag?   The <pre> tag in HTML is used to define the block of preformatted text which preserves the text spaces, line breaks, tabs, and other formatting characters which are ignored by web browsers. Text in the <pre> element is displayed in a fixed-width font, but it can be changed using CSS.



The <pre> tag defines preformatted text. Text in an <pre> element is displayed in a fixed-width font, and the text preserves both spaces and line breaks. The text will be displayed exactly as written in the HTML source code.



Attributes:


HTML tags can contain one or more attributes. Attributes are added to a tag to provide the browser with more information about how the tag should appear or behave. Attributes consist of a name and a value separated by an equals (=) sign, with the value surrounded by double-quotes. Here's an example, style="color:black;".


There are 3 kinds of <pre> attributes that you can add to your HTML tags: 

Element-specific, global, and event handler content attributes.


Supported Browsers: 


  • Google Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari


Use of <pre> tag in Html with example Tips and Notes:



Tip: Use the <pre> element when displaying text with unusual formatting, or some sort of computer code.



Example: How to create a pre-formatted text with a fixed width (with CSS):


 

Try now



Default CSS Settings:

Most browsers will display the <pre> element with the following default values:



 

This full HTML code will help you to understand partially by copying code below and try it with AR3school Html editor:


Try now

Comments :

Post a Comment