简体   繁体   English

如何在HTML CSS Bootstrap或angular js中制作编程代码框

[英]How to make a programming code box in html css bootstrap or angular js

如何在HTML CSS Bootstrap或angular js中制作编程代码框

One way is to use w3-include 一种方法是使用w3-include

<!DOCTYPE html>
<html>
    <script src="https://www.w3schools.com/lib/w3data.js"></script>

    <body>

    <div w3-include-html="content.html"></div> 

    <script>
        w3IncludeHTML();
    </script>

</body>
</html>

Or PHP style 还是PHP风格

<html>
    <body>

        <h1>Welcome to my home page!</h1>
        <p>Some text.</p>
        <p>Some more text.</p>
        <?php include 'footer.php';?>

    </body>
</html>

To complete, here's a JQuery style (thanks @Manivannan for the link) 要完成,这是一个JQuery样式(感谢@Manivannan提供的链接)

<html>
    <head>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"</script>
        <script> 
            $(function(){
                $("#headerDiv").load("header.html");
            });  
        </script>
    </head>
    <body>
        <div id="headerDiv"></div>
        <!-- Rest of the code -->
    </body>
</html>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 JS/CSS/HTML 编程中会有这部分代码的更短版本吗? - Would there be a shorter version of this part of code in JS / CSS / HTML programming? 如何在悬停时制作HTML框,并使用JS或CSS显示其下方的文本 - How can I make an HTML box slide on hover and reveal the text underneath it using JS or CSS 如何使输入框中的第三个项目具有不同的颜色? (JS、HTML、CSS) - How can I make the third item entered into an input box a different color? (JS, HTML, CSS) 我如何使用 html css js 制作带有搜索栏的自定义 select 框 - How I can make custom select box with search bar using html css js 如何使用HTML代码制作一个响应框? - how to make a responsive box using html code? 如何编辑此代码HTML / CSS以使“选择” JS代码也复制2个剪贴板? - How to Edit this Code HTML/CSS to Make the 'Select' JS code also Copy 2 Clipboard? 如何在Angular 2中添加完整的HTML,CSS和JS - How to Add Full HTML, CSS, and JS in Angular 2 如何使我的.css和.js文件与我在Android上的WebView中加载的html代码一起使用 - How to make my .css and .js file work with my html code loaded in a WebView on Android 在html文件中有2个CSS代码块,如何仅使用JS进行一项工作? - Having 2 css code blocks in html files how to make only one work using JS? 未占用空间中的额外元素选择框(HTML/JS/CSS w/Angular.js) - Extra Element Selection Box In Unoccupied Space (HTML/JS/CSS w/ Angular.js)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM