Open In App

HTML | <pre> width Attribute

Last Updated : 05 Jan, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

The HTML <pre> width Attribute is used to specify the maximum number of characters per line.

Note: The

 width Attribute is not supported by HTML5 

Syntax:
<pre width="number"> 

Attribute Values:

  • number: It is used to set the maximum number of characters.

Example:




<!DOCTYPE html>
<html
  
<head
    <title>
        HTML pre width Attribute
    </title>
      
    <style>
        h4 {
            text-align:center;
        }
    </style>
</head
  
<body
    <h1 style="color:green;">GeeksforGeeks</h1>
      
    <h2>HTML <pre> width Attribute</h2>
          
    <pre width="10">GeeksforGeeks 
        A Computer Science Portal For Geeks 
    </pre
</body
  
</html>


Output:

Supported Browsers: The HTML <pre> width attribute is not supported by any browsers. CSS property are used instead.


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads