简体   繁体   中英

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

<!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

<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)

<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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM