【问题标题】:How to import specific div in php file to another php file如何将php文件中的特定div导入另一个php文件
【发布时间】:2021-04-04 11:42:14
【问题描述】:

我需要在 about.php 文件中插入“inner-header-bottom-region-about” div。无需在 about 页面中插入另一个 div。如何将其插入 about.php 文件中?

<div id="inner-header-bottom-region-about">
  <div id="header-bottom">
    </div>
  <div id="header-inner">
    
  </div>
</div>

<div id="inner-header-bottom-region-work">
  <div id="header-bottom">
    
  </div>
  <div id="header-inner">
   
  </div>
</div>

【问题讨论】:

  • 发布您的代码而不是图片。
  • 将该 div 放入自己的 PHP 文件中,然后可以将其分别包含在您需要的两个地方。

标签: php html include


【解决方案1】:

你可以创建一个只有inner-header-bottom-region-about div的新php文件,并使用php include属性将这个新的php文件包含在你想要的div中

【讨论】:

    猜你喜欢
    • 2018-10-14
    • 2012-10-10
    • 1970-01-01
    • 1970-01-01
    • 2014-10-11
    • 1970-01-01
    • 2017-03-01
    • 2021-08-31
    • 1970-01-01
    相关资源
    最近更新 更多