How to make a programming code box in html css bootstrap or angular js
Asked
Active
Viewed 1,139 times
0
-
Here is the answer which uses jquery http://stackoverflow.com/a/35249951/4874281 – manian Mar 28 '17 at 05:21
1 Answers
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
-
-
-
-
-
-
shubam gupta, you don't have to be an expert in php. You just can use the simple include function added by @Carl Jan – manian Mar 28 '17 at 05:28
-
-
and Sir for that code Manivannan sir had said that we have to use Server ? How ? @CarlJan – shubham gupta Mar 29 '17 at 04:56
-
-
If you're in Windows, use [XAMPP](https://www.apachefriends.org/), and if you are in Linux, use [LAMP](https://www.linux.com/learn/easy-lamp-server-installation) – Carl Binalla Mar 29 '17 at 04:59
-
-
Then start studying them, you will be needing them sooner or later – Carl Binalla Mar 29 '17 at 05:01
-
-
-
sir shall we communicate with each other on social media like instagram or facebok @CarlJan – shubham gupta Mar 29 '17 at 05:03
-