dtcmadj31951 2016-03-13 19:11
浏览 55

包含带有Doctype声明的文件

Let's say I have 3 files:

  1. index.php - the main file. It has declaration.
  2. sources.php - a file that has html code that fetches jquery, bootstrap etc that I'll include in the main (index.php) file. It also has declaration.
  3. header.php - a file that has html code that creates the header for the multiple webpages. It will also be included in the main (index.php) file. It also has declaration.

My question is, are the doctype declarations necessary in the sources.php and header.php files?

The code works perfectly fine with them. But, if I only did the declaration in the index file then included the other sources.php file in the head and the header.php right after the opening body tag would it affect my project negatively? Do I really need to have the declaration thrice?

P.S. I know I could just try it by myself but I'm not on my computer and won't be for the next couple of days and I don't want to start installing things on someone else's computer. Anyway, thank you in advance..

  • 写回答

1条回答 默认 最新

  • douzuqin3467 2016-03-13 19:49
    关注

    You dont need both

    1) you keep it in index.php, you dont need it in anything else

    2) or you keep it in the templates, index.php has nothing, but index.php cannot output anything before loading the template

    评论

报告相同问题?

悬赏问题

  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 划分vlan后不通了
  • ¥15 GDI处理通道视频时总是带有白色锯齿
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大
  • ¥15 使用EMD去噪处理RML2016数据集时候的原理