jellyfishhh

applehtml

Jun 14th, 2026
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | Source Code | 0 0
  1. <html>
  2. <head>
  3. <link rel="stylesheet" href="apple.css">
  4. </head>
  5. <body>
  6. <div class="parent">
  7. <div class="header">
  8. <img src="images/applleee.jpg" alt="Apple image">
  9. </div>
  10.  
  11. <div class="navbar">
  12. <a href="#home" class="nav-btn button-home" onclick="showSection('home', event)">Home</a>
  13. <a href="#about" class="nav-btn button-about" onclick="showSection('about', event)">About</a>
  14. <a href="#more" class="nav-btn button-more" onclick="showSection('more', event)">More</a>
  15. <!---- copy and paste to add more buttons, change the ref to the section id.-->
  16.  
  17. </div>
  18.  
  19. <div class="left">
  20. <h2>Sidebar 1</h2>
  21. </div>
  22.  
  23. <!--- the main section is here. New pages can be added by making section IDs much like the about and more-->
  24. <div class="middle">
  25. <section id="home" class="page-section" style="display: block;">
  26. <h1>Main Content</h1>
  27. <p>Main content here. This section will be the default.
  28. <h3>another header style</h3>
  29.  
  30.  
  31. </p>
  32. </section>
  33.  
  34. <section id="about" class="page-section" style="display: none;">
  35. <h1>About</h1>
  36. <p>About content here.
  37. </p>
  38. </section>
  39.  
  40. <section id="more" class="page-section" style="display:none;">
  41. <h1>More </h1>
  42. <p> More here.</p>
  43. </section>
  44. </div>
  45.  
  46. <div class="right">
  47. <h2>Sidebar 2</h2>
  48. </div>
  49.  
  50. <div class="footer"></div>
  51. </div>
  52.  
  53. <script>
  54. function showSection(sectionId, event) {
  55. event.preventDefault();
  56. document.querySelectorAll('.page-section').forEach(function(section) {
  57. section.style.display = 'none';
  58. });
  59. var target = document.getElementById(sectionId);
  60. if (target) target.style.display = 'block';
  61. }
  62. </script>
  63. </body>
  64. </html>
Advertisement
Add Comment
Please, Sign In to add comment