Advertisement
TermSpar

Let's Build a Website

Jun 12th, 2016
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.97 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.     <head>
  4.  
  5.         <meta charset="utf-8">
  6.         <title>The Sun</title>
  7.  
  8.         <style>
  9.         #title{
  10.           color: blue;
  11.           text-align: center;
  12.           font-family: "Arial";
  13.           font-size: 50px;
  14.         }
  15.  
  16.         body{
  17.           background-color: black;
  18.         }
  19.  
  20.         #picSun{
  21.           position: absolute;
  22.           left: 20px;
  23.           top: 200px;
  24.         }
  25.  
  26.         #btnSunInfo{
  27.           position: absolute;
  28.           left: 20px;
  29.           top: 550px;
  30.         }
  31.  
  32.         #btnHideSun{
  33.           position: absolute;
  34.           left: 300px;
  35.           top: 550px;
  36.         }
  37.  
  38.         #sunList{
  39.           color: white;
  40.           position: absolute;
  41.           left: 20px;
  42.           top: 600px;
  43.         }
  44.  
  45.         .btnStyle{
  46.           background-color: green;
  47.           color: white;
  48.           border-radius: 15px;
  49.           border: 1px solid green;
  50.           padding: 10px 13px;
  51.           cursor: pointer;
  52.         }
  53.         </style>
  54.  
  55.     </head>
  56.       <script>
  57.         var showSun = function(){
  58.           document.getElementById("sunList").innerHTML = '<li>The Sun is the star at the center of the Solar System</li> <li>The Sun is a G-type main-sequence star (G2V)</li> <li>The Sun is roughly middle aged and has not changed dramatically for over four billion</li>';
  59.         }
  60.  
  61.         var hideSun = function(){
  62.           document.getElementById("sunList").innerHTML = '<p></p>';
  63.         }
  64.       </script>
  65.   <body>
  66.  
  67.     <h1 id="title">The Sun</h1>
  68.  
  69.     <img id="picSun" src="https://upload.wikimedia.org/wikipedia/commons/b/b4/The_Sun_by_the_Atmospheric_Imaging_Assembly_of_NASA's_Solar_Dynamics_Observatory_-_20100819.jpg"
  70.    alt="Picture of the Sun" width="350">
  71.  
  72.     <button id="btnSunInfo" onclick="showSun()" class="btnStyle">Show Info</button>
  73.     <button id="btnHideSun" onclick="hideSun()" class="btnStyle">Hide Info</button>
  74.  
  75.     <ul id="sunList">
  76.  
  77.     </ul>
  78.  
  79.   </body>
  80. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement