⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 changefont.htm

📁 网页颜色渐变,可实现网页中背景色的渐变效果
💻 HTM
字号:
<html>
  <head>
    <title>dhtml demo </title>
    <script>
       <!--
         function tick(){
            var hours,minutes,seconds,ap;
            var inthours,intminutes,intseconds;
            var today;
            today = new Date();
            inthours=today.gethours();
            intminutes=today.getminutes();
            intseconds=today.getseconds();

            if (inthours==0){
               hours="12:";
               ap="midnight";
            }else if(inthours<12)
              {hours=inthours+":";
              ap="A.M.";
            }else if (inthours==12){
               hours="12:";
               ap="Noon";
            }else{
             inthours=inthours-12
             hours=inthours+":";
             ap="P.M.";
            }

            if (intMinutes<10){
               minutes="0" + intminutes+":";
             }else{
                minutes=intminutes+":";
             }

            if (intseconds<10){
               seconds="0"+intseconds+"";
             }else{
             seconds=intseconds+"";
             }
 
            timeString=hours+minutes+seconds+ap;

            Clock.innerHTML=timeString;

            window.setTimeout("tick();",100);
            }

            window.onload=tick;
         -->
         </script>
      </head>

      <body>
         <h1>改变页面样式</h1>
         <div id="Clock" align="center"></div>
         <table border="1">
            <tr>
              <td>时钟颜色</td>
              <td>时钟背景</td>
              <td>时钟字体</td>
              <td>字体尺寸</td>
              <td>字体粗细</td>
             </tr>
            <tr>
              <td colspan="5">   </td>
            </tr>
            <tr>
              <td> <span onmouseover="this.style.cursor='hand'"
           onmouseout="this.style.cursor=default"
           onclick="Clock.style.color='purple'">紫色</span>
              </td>
                 <td> <span onmouseover="this.style.cursor='hand'"
                  onmouseout="this.style.cursor=default"
                  onclick="Clock.style.background='red'">红色</span>
                 </td>
                     <td><span onmouseover="this.style.cursor='hand'"
                       onmouseout="this.style.cursor=default"
                       onclick="Clock.style.font-family='verdana'">无边饰</span>
                     </td>
                        <td><span onmouseover="this.style.cursor='hand'"
                          onmouseout="this.style.cursor=default"
                          onclick="Clock.style.font-size='24pt'">24pt</span>
                        </td>
                           <td><span onmouseover="this.style.cursor='hand'"
                              onmouseout="this.style.cursor=default"
                              onclick="Clock.style.fontweight='normal'">普通</span>
                           </td>
                              <tr>
                                 <td><span onmouseover="this.style.cursor='hand'"
                                     onmouseout="this.style.cursor=default"
                                     onclick="Clock.style.color='white'">白色</span>
                           </td>
                               <td><span onmouseover="this.style.cursor='hand'"
                                  onmouseout="this.style.cursor=default"
                                  onclick="Clock.style.background='yellow'">黄色</span>
                           </td>
                               <td><span onmouseover="this.style.cursor='hand'"
                                  onmouseout="this.style.cursor=default"
                                  onclick="Clock.style.font-family='georgia'">有边饰</span>
                           </td>
                              <td><span onmouseover="this.style.cursor='hand'"
                                 onmouseout="this.style.cursor=default"
                                 onclick="Clock.style.font-size='36pt'">36pt</span>
                           </td>
                           <td><span onmouseover="this.style.cursor='hand'"
                               onmouseout="this.style.cursor=default"
                               onclick="Clock.style.font-weight='bold'">粗体</span>
                           </td>
                             </tr>
                           </table>
                       </body>
                     </html>




 

                 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -