My Page


We are going to make your own persanal Web Page, using HTML, images and links.

For an example click here


Directions
  1. 1. Open Sublime and build a webpage by adding:
    <html>
    
    <head>
    <title>Maya's Page </title>
    </head>
    
    
    <body>
    
    This is my page
    
    </body>
    
    </html>
    
    to an empty file. Save it with a .html extension.


  2. Add an headline to the page:
    <h1>This is Maya's Page </h1>

  3. Add an image, with an explanation.
    Use <img src="http://www.images.com/havenese.jpg">

    This is a picture of a Havanese, my favorite kind of Dog.

  4. Make the most important word in the explanation red.
    Use: <font color="red"> this word </font>

    This is a picture of a Havanese, my favorite kind of Dog.

  5. Add a link to your favorite site, use:
    <a href = "http://www.netflix.com"> Link to Netflix </a> Add an explanation why you like the site.

  6. Add a button:
    <button onClick = "DO_STUFF">ShowIt</button>
    and a label.
    <p id="theLabel">This is My Label!</p>

  7. Now you are ready to write your first JavaScrpt code!
    Between <script> tags, add a function called showIt:
    
    <script>
    
    function showIt() {
    
    }
    
    </script>
    
    
  8. Make the function change theLabel to say "Hello." Use: document.getElementById("theLabel").innerHTML = "Hello! I am alive!";


  9. Run the function when the button is clicked by adding:
    onClick = "showIt();"
    to the Button. Test that everything is working. If so, you have JavaScript code!

  10. Change the background color of the page using :
    document.body.style.backgroundColor = "lightblue";

  11. Add an input field.
    <input type="text" size=50 id="inputField" value="You say...">

    When the button is clicked, have the function take whatever the user has typed in the input field and show it on the label with:

    document.getElementById("theLabel").innerHTML = "You said: " + document.getElementById("inputField").value

    Thats it! You can customize this page as much as you like, then show it to your friends to admire








(c) 2016 by Code Craft Academy