Tab Characters in HTML 'pre' Element


Are Tab Characters Preserved in a "pre" Element?



Yes. Tab characters are preserved in pre elements like other white space characters. Below is a good tutorial example of using "pre" elements:

<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  <title>Tab Characters in PRE Elements</title>
XHTML	Extensible Hyper-Text Markup Language

HTML	Hyper-Text Markup Language

XML	Extensible Markup Language

If you save the above document as tab.html, and view it with Internet Explorer, you will see that tab characters are well preserved by the browser. Line feed characters are also preserved as shown below:
HTML pre Element with Tab Characters


⇒HTML Body Tag and Block Level Tags

⇒⇒HTML Tutorials

2017-02-20, 945👍, 0💬