dollcrds

neocities tutorial #1 html

May 11th, 2025 (edited)
4,035
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. // main container (everything NOT in the sections that change outside of music player & marquee)
  2. <div class="main">
  3. <img src=""welcome to profile" IMG LINK HERE">
  4. <img src="DOLL IMG LINK HERE" style="position: absolute; left: 20em; top: 0em; width: 350px;">
  5. <img src=""i love purple" BLINKIE IMG LINK HERE" style="position: absolute; left: 22.2em; top: 22.5em; width: 250px;">
  6. <div class="button-container"><button><a onclick="loadPage('page1')"><img src="BUTTON PIXEL IMG LINK HERE" style="width: 30px;"></a></button><br><br><button><a onclick="loadPage('page2')"><img src="BUTTON PIXEL IMG LINK HERE" style="width: 30px;"></a></button><br><br><button><a onclick="loadPage('page3')"><img src="BUTTON PIXEL IMG LINK HERE" style="width: 30px;"></a></button><br><br>
  7. </div>
  8.  
  9. // MUST PUT THIS AFTER CODE ABOVE AND BEFORE CODE BELOW - allows for website to have "pages" and to change from section to section properly
  10. <div id="content">
  11. </div>
  12.  
  13. // 3 page outline
  14. <script>
  15. const pages = {
  16. page1: `CODE HERE`,
  17. page2: `CODE HERE`,
  18. page3: `CODE HERE`
  19. };
  20.  
  21. // link format - target blank allows page to open in new tab
  22. subscribe to me on <a href="LINK HERE" target="_blank"><mark>youtube</mark></a>
  23.  
  24. // js allowing page 1 to load by default and ensuring transition from section to section runs smoothly - js cannot be disabled on your browser for this to work (there are alternative methods but those are more complex/less efficient)
  25. function loadPage(pageKey) {
  26. document.getElementById('content').innerHTML = pages[pageKey];
  27. }
  28.  
  29. loadPage('page1');
  30. </script>
Advertisement
Add Comment
Please, Sign In to add comment