Guest User

Untitled

a guest
May 20th, 2018
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.36 KB | None | 0 0
  1. <!doctype html>
  2. <html lang=en>
  3. <head>
  4. <meta charset=utf-8>
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
  8.  
  9. <meta name="description" content="">
  10. <meta name="author" content="">
  11. <link rel="icon" href="./img/favicon.ico">
  12.  
  13.  
  14. <title>Study Site</title>
  15. <link rel="stylesheet" type="text/css" href="./css/default.css">
  16.  
  17. </head>
  18.  
  19. <body>
  20. <nav>
  21. <div class="row" style="border:2px solid red;">
  22. <div id="navimport">Loading Nav Bar</div>
  23. </div>
  24. </nav>
  25.  
  26. <main role="main" class="container">
  27.  
  28. <div id="sidebar">
  29. Side Bar
  30. </div>
  31.  
  32. <div id="mainbody">
  33. Main Body
  34. </div>
  35.  
  36. </main> <!-- container -->
  37.  
  38. </body>
  39.  
  40. <script>
  41. window.onload = function(){
  42. file="http://localhost/learning/navbar.html";
  43. x = new XMLHttpRequest;
  44. elem = document.getElementById("navimport");
  45.  
  46. //Set up the call back
  47. x.onreadystatechange = function() {
  48. if (this.readyState == 4) {
  49. if (this.status == 200) {elem.outerHTML =x.responseText;} //{elem.innerHTML = x.responseText; elem.Textcontent = x.responseText;}
  50. if (this.status == 404) {elem.innerHTML = "Page not found.";}
  51. /*remove the attribute, and call this function once more:*/
  52. //elmnt.removeAttribute("w3-include-html");
  53. //includeHTML();
  54. }
  55. }
  56.  
  57. x.open("GET", file, true);
  58. x.send();
  59. }
  60.  
  61. </script>
  62. </html>
  63.  
  64. .row{
  65. width:100%;
  66. }
  67.  
  68.  
  69. /* Extra small devices (phones, less than 768px) */
  70. /* No media query since this is the default */
  71.  
  72. #sidebar{
  73. width:100%;
  74. float:left;
  75. border:1px solid blue;
  76. }
  77. #mainbody{
  78. width:100%;
  79. border: 1px solid green;
  80. float:left;
  81. }
  82.  
  83.  
  84. /* Small devices (tablets, 768px and up) */
  85. @media (min-width: 768px) {
  86. #sidebar{
  87. width:24%;
  88. float:right;
  89. }
  90. #mainbody{
  91. width:74%;
  92. border: 1px solid blue;
  93.  
  94. }
  95. }
  96.  
  97. /* Medium devices (desktops, 992px and up) */
  98. @media (min-width: 992px) {
  99. #sidebar{
  100.  
  101. }
  102. #mainbody{
  103. border: 1px solid orange;
  104. }
  105. }
  106.  
  107. /* Large devices (large desktops, 1200px and up) */
  108. @media (min-width: 1200px) {
  109.  
  110. }
  111.  
  112. <style>
  113. .navul {
  114. list-style-type: none;
  115. margin: 0;
  116. padding: 0;
  117. }
  118.  
  119.  
  120. .navul li {
  121. float:left;
  122. }
  123.  
  124. .navul li a {
  125. display: block;
  126. color: #000;
  127. padding: 8px 16px;
  128. text-decoration: none;
  129. }
  130.  
  131.  
  132.  
  133. /* Change the link color on hover */
  134. .navul li a:hover {
  135. background-color: #555;
  136. color: white;
  137. }
  138.  
  139. .active {
  140. background-color: #4CAF50;
  141. color: white;
  142. }
  143. </style>
  144. <div style="width:100%;">
  145. <ul class="navul">
  146. <li><a href="#">Home</a></li>
  147. <li><a href="#">Products</a></li>
  148. <li><a href="#">Services</a></li>
  149. <li><a href="#">About Us</a></li>
  150. <li><a href="#">Contact Us</a></li>
  151. </ul>
  152. </div>
Add Comment
Please, Sign In to add comment