weixin_33720452 2018-08-13 00:36 采纳率: 0%
浏览 52

将HTML导入HTML

I need to import A.html and B.html and C.html into Index.html

The way that I tried.....it can work, but dont know way only one is normal, other not link with their css


below is my index.html

it can work, but only D.html is link its css. Others looks not right layout with their css.

<link rel="stylesheet" href="css/index.css">
<link rel="stylesheet" href="css/A.css">
<link rel="stylesheet" href="css/B.css">
<link rel="stylesheet" href="css/C.css">
<link rel="stylesheet" href="css/D.css">


<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js" defer></script>
<section ng-app="">
  <div ng-include="'section/A.html'"></div>
  <div ng-include="'section/B.html'"></div>
  <div ng-include="'section/C.html'"></div>
  <div ng-include="'section/D.html'"></div>
</section>
  • 写回答

1条回答 默认 最新

  • elliott.david 2018-08-13 01:07
    关注

    here is a codepen project I did to help you with your issue: https://codepen.io/ideaguy3d/project/editor/AdzPdm

    I just added an angular app and pointed ng-app to it:

    app.js:

    angular.module('myApp', []);
    

    index.html:

    ```

       <section ng-app="myApp">
    
            <div ng-include="'section/A.html'"></div>
            <div ng-include="'B.html'"></div>
    
        </section>
    

    ```

    Make sure there is a folder called "section" in your project as well.

    评论

报告相同问题?

悬赏问题

  • ¥15 对于知识的学以致用的解释
  • ¥50 三种调度算法报错 有实例
  • ¥15 关于#python#的问题,请各位专家解答!
  • ¥200 询问:python实现大地主题正反算的程序设计,有偿
  • ¥15 smptlib使用465端口发送邮件失败
  • ¥200 总是报错,能帮助用python实现程序实现高斯正反算吗?有偿
  • ¥15 对于squad数据集的基于bert模型的微调
  • ¥15 为什么我运行这个网络会出现以下报错?CRNN神经网络
  • ¥20 steam下载游戏占用内存
  • ¥15 CST保存项目时失败