Practice HTML, CSS, & JavaScript Code: Jump to a Section

HTML
CSS
JavaScript

HTML 


(Back to Top)





HTML code example. These are the most basic HTML tags needed to write a web page.

<html> <head> <style> </style> <script> </script> </head> <body> </body> </html>

CSS 


(Back to Top)





CSS code example. Here are the CSS conditions needed to stylize a navagation menu pane like the one found after clicking the hamburger button of this webpage.

<style> .sidenav { height: 900px; width: 0; position: fixed; overflow-y: auto; z-index: 1; top: 0; left: 0; background-color: #111; overflow-x: hidden; transition: 0.5s; padding-top: 30px; } .sidenav a { padding: 8px 8px 8px 32px; text-decoration: none; font-size: 25px; color: #818181; display: block; transition: 0.3s; } .sidenav a:hover { color: #f1f1f1; text-decoration: underline; } .sidenav .closebtn { position: absolute; top: 0; right: 25px; font-size: 36px; margin-left: 50px; } @media screen and (max-height: 450px) { .sidenav {padding-top: 15px;} .sidenav a {font-size: 18px;} } </style>

JavaScript 


(Back to Top)




Paragraph

JavaScript code example. Here is the JavaScript code for the above example. The paragraph, button, and script can all go in the body section of your HTML:

<p id = "demo">Paragraph</p> <button type = "button" onclick = "changeParagraph()"> Click me to change the content of the text above. </button> <script> function changeParagraph() { document.getElementById("demo").innerHTML = "Paragraph Changed."; } </script>