HTC入門樣本(二)

來源:互聯網
上載者:User

HTC入門樣本(二)

<!--*****************input.htc******************-->

<script>
switch(type)
{
  case 'text':
  case 'password':  //文本輸入框和密碼輸入框的樣式
    style.border="1px solid #000000";
    style.backgroundColor="#FFFFFF";
    style.height="18px";
    style.font="normal 12px 宋體";
    style.color="#000000";
    break;
  case 'submit':
  case 'reset':
  case 'button':  //按鈕類的樣式(不包括圖片按鈕)
    style.border="1px solid #000000";
    style.backgroundColor="#CCCCCC";
    style.height="18px";
    style.font="normal 12px 宋體";
    style.color="#000000";
    break;
  default:  //對於象單選框多選框等上面沒有出現過的元素,我們使用預設樣式。
    ;
}
</script>

<!--**************************Demo2.html***************************************-->

<head>
<title>用HTC統一定製表單樣式執行個體</title>
<style type=text/css>
body  { font:normal 14px 宋體; }
input  { behavior:url('input.htc'); }
</style>
</head>

<body>
<form>
  文字框:  <input type=text><br><br>
  密碼輸入框:<input type=password><br><br>
  檔案選擇框:<input type=file><br><br>
  單選框:  <input type=checkbox><br><br>
  多選框:  <input type=radio><br><br>
  提交按鈕: <input type=submit value=提交><br><br>
  重設按鈕: <input type=reset value=重設><br><br>
  普通按鈕: <input type=button value=返回><br><br>
  圖片銨鈕: <input type=image src=button.gif>
</form>
</body>

注意:首先你得找一張名為“button.gif”的圖片。

這個樣本更多的表現了HTC對樣式的支援,給人以新的感覺,HTC檔案也可以這樣學。沒有對象,沒有事件,沒有方法。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.