当前位置:   article > 正文

WEB开发技能树-HTML-pre标签_web的pre

web的pre

1 需求

<pre> 标签可定义预格式化的文本。

被包围在 <pre> 标签 元素中的文本通常会保留空格和换行符。而文本也会呈现为等宽字体。


2 语法


3 示例

  1. <?php
  2. header('Content-Type: text/html; charset=utf-8');
  3. echo '<pre>';
  4. ?>
  5. <!doctype html>
  6. <html lang="en">
  7. <head>
  8. <meta charset="UTF-8">
  9. <title>Document</title>
  10. </head>
  11. <body>
  12. 1 2
  13. 3
  14. </body>
  15. </html>

  1. <?php
  2. header('Content-Type: text/html; charset=utf-8');
  3. //echo '<pre>';
  4. ?>
  5. <!doctype html>
  6. <html lang="en">
  7. <head>
  8. <meta charset="UTF-8">
  9. <title>Document</title>
  10. </head>
  11. <body>
  12. 1 2
  13. 3
  14. </body>
  15. </html>


4 参考资料

HTML <pre> 标签 | 菜鸟教程

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/weixin_40725706/article/detail/197717
推荐阅读
相关标签
  

闽ICP备14008679号