Preservative tag-ஆனது body tag-க்குள் உள்ளவற்றை அதன் வடிவம் கொஞ்சம் கூட மாறாமல் அப்படியே browser-ல் வெளிப்படுத்த உதவுகிறது. உதாரணத்துக்கு பின்வருமாறு ஒரு program-ஐ <pre> tag இல்லாமல் அடித்து, browser-ல் திறந்து பார்க்கவும்.

File: pre.html

<html>

<head><title></title></head>

<body>

<center>Kannan Store</center>

Customer Name: T.Shrinivasan

Product Price

Hamam soap Rs.25

Sugar Rs.50

Rice Rs.150

</body>

</html>

body tag-க்குள் நாம் ஒவ்வொரு வரிக்கும் கொடுத்த இடைவெளி, tag space எல்லாம் புறக்கணிக்கப்பட்டு, வெறும் எழுத்துக்கள் மட்டும் browser-ல் வெளிப்பட்டுவிட்டது. இப்போது அதே program-ஐ pre tag கொடுத்து browser-ல் open செய்து பார்க்கவும்.

File: pre.html

<html>

<head><title></title></head>

<body>

<pre>

<center>Kannan Store</center>

Customer Name: T.Shrinivasan

Product Price

Hamam soap Rs.25

Sugar Rs.50

Rice Rs.150

</pre>

</body>

</html>

இப்போது நாம் கொடுத்த எழுத்தின் வடிவம் கூட மாறாமல், அவை browser-ல் வெளிப்படுவதைக் காணலாம். எனவேதான் <pre> tag மிகவும் பயனுள்ளதாகக் கருதப்படுகிறது.

License

Icon for the Creative Commons Attribution-ShareAlike 4.0 International License

எளிய தமிழில் HTML Copyright © 2015 by து. நித்யா is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License, except where otherwise noted.

Share This Book