Advertisement
1vannn

Web Portal

Nov 9th, 2015
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.29 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4.     <style type="text/css">
  5.         body {
  6.             width: 100%;
  7.             height: 100%;
  8.             margin: 0px;
  9.         }  
  10.         #main {
  11.             width: 100%;
  12.             height: 25%;
  13.             background: #113B51;
  14.             position: absolute;
  15.         }
  16.         #main p {
  17.             color: white;
  18.             font-size: 64px;
  19.             margin-right: 5px;
  20.             margin-left: 5px;
  21.             margin-top: 5px;
  22.             margin-bottom: 5px;
  23.         }
  24.     </style>
  25.     <script type="text/javascript">
  26.         function sayDate() {
  27.             var d = new Date();
  28.             var y = d.getFullYear(); // year
  29.             var m = d.getMonth();
  30.             var da = d.getDate();
  31.             var months = ['January','February','March','April','May','June','July','August','September','October','November','December'];
  32.             var curMon = months[m];
  33.             if (da == 1) {
  34.                 suffix = "st";
  35.             } else if (da == 2) {
  36.                 suffix == "nd";
  37.             } else if (da == 3) {
  38.                 suffix == "rd";
  39.             } else if (da == 4) {
  40.                 suffix == "th";
  41.             } else if (da == 5) {
  42.                 suffix == "th";
  43.             } else if (da == 6) {
  44.                 suffix == "th";
  45.             } else if (da == 7) {
  46.                 suffix == "th";
  47.             } else if (da == 8) {
  48.                 suffix == "th";
  49.             } else if (da == 9) {
  50.                 suffix == "th";
  51.             } else if (da == 10) {
  52.                 suffix == "th";
  53.             } else if (da == 11) {
  54.                 suffix == "th";
  55.             } else if (da == 12) {
  56.                 suffix == "th";
  57.             } else if (da == 13) {
  58.                 suffix == "th";
  59.             } else if (da == 14) {
  60.                 suffix == "th";
  61.             } else if (da == 15) {
  62.                 suffix == "th";
  63.             } else if (da == 16) {
  64.                 suffix == "th";
  65.             } else if (da == 17) {
  66.                 suffix == "th";
  67.             } else if (da == 18) {
  68.                 suffix == "th";
  69.             } else if (da == 19) {
  70.                 suffix == "th";
  71.             } else if (da == 20) {
  72.                 suffix == "th";
  73.             } else if (da == 21) {
  74.                 suffix == "th";
  75.             } else if (da == 22) {
  76.                 suffix == "th";
  77.             } else if (da == 23) {
  78.                 suffix == "th";
  79.             } else if (da == 24) {
  80.                 suffix == "th";
  81.             } else if (da == 25) {
  82.                 suffix == "th";
  83.             } else if (da == 5) {
  84.                 suffix == "th";
  85.             } else if (da == 5) {
  86.                 suffix == "th";
  87.             } else if (da == 5) {
  88.                 suffix == "th";
  89.             } else if (da == 5) {
  90.                 suffix == "th";
  91.             }
  92.             document.write(curMon + ', ' + da + '' + suffix;
  93.         }
  94.     </script>
  95.     <title>Ivan's Web Portal</title>
  96. </head>
  97. <body>
  98.     <div id="main">
  99.         <p>
  100.             Hello, today is <script type="text/javascript">sayDate()</script>.
  101.         </p>
  102.     </div>
  103. </body>
  104. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement