0

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

shubham gupta
  • 27
  • 1
  • 1
  • 8

1 Answers1

2

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>
Community
  • 1
  • 1
Carl Binalla
  • 5,393
  • 5
  • 27
  • 46