HTML5寫的註冊頁面,正在學習html5的朋友可以參考下
程式碼如下:
<!DOCTYPE html> <html> <head> <title>register.html</title> <meta http-equiv=" key words" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="this is my page"> <meta http-equiv="content-type" content="text/html; char set =UTF-8"> <LINK rel="Shortcut icon" href="favicon.ico" /> <link rel="stylesheet" type="text/css" href="css/register.css" /> <script src="js/checkbox.js" type="text/ javascript "> </script> <script type="text/javascript"> function play(){ document .getElementById("menu_item").style. display = ""; } function noplay(){ document.getElementById("menu_item").style.display = "none"; } function passwd(){ var pass = document.getElementById("password").value; var tip = document.getElementById("tip"); if (pass.length < 4) { document.getElementById("meter").value = pass.length; tip.innerHTML = "差"; } else if (pass.length <= 8) { document.getElementById("meter").value = pass.length; tip.innerHTML = "中"; } else { document.getElementById("meter").value = pass.length; tip.innerHTML = "高"; } } </script> </head> <body> <p id="3" style=" position : relative; top : 100px; z-index : 3;"> < for m id="f1" action ="register.html" method="post"> <table align="center" cellspacing="0" class="table"> <tr class="thead"> <td align="center"> 会员注册 </td> </tr> <tr> <td> <table id="registertable" border="0px" align="center" border="0px" cellspacing="0" cell padding ="5px"> <tr> <tr> <td align="right"> 员工编号: </td> <td align=" left "> <input type="text" name="username" placeholder="用户名" require d/> </td> </tr> <tr> <td align="right"> 密 码: </td> <td align="left"> <input type="password" name="password" id="password" placeholder="密码" required onkeyup ="passwd()"/> <meter min="1" max="10" low="5" high="8" value="0" id="meter"> </meter> <span id="tip"></span> </td> </tr> <tr> <td align="right"> 密码确认: </td> <td align="left"> <input type="password" name="password2" placeholder="确认密码" required/> </td> </tr> <tr> <td align="right"> 生 日: </td> <td align="left"> <input type=" date " name="borthday" /> </td> </tr> <tr> <td align="right"> 性 别: </td> <td align="left"> <input type="radio" name="g end er" value="0" checked/>男 <input type="radio" name="gender" value="1"/>女 </td> </tr> <tr> <td align="right"> 邮 箱: </td> <td align="left"> <input type=" email " name="email" placeholder="邮箱" id="email" required/> </td> </tr> <tr> <td align="right"> 手 机: </td> <td align="left"> <input type="tel" pattern="[0-9]{11}" id="p" name="phone" placeholder="请输入11位数字" /> </td> </tr> <tr> <td align="right"> 地 址: </td> <td align="left"> <input type="text" name="address" placeholder="地址" list ="l"/> <datalist id="l"> <option value="sh">上海</option> <option value="bj">北京</option> <option value="js">江苏</option> <option value="zz">郑州</option> <option value="sz">深圳</option> </datalist> </td> </tr> <tr> <td align="right"> 个人网页: </td> <td align="left"> <input type="url" name="page" placeholder="主页网址" /> </td> </tr> <tr> <td align="right"> 起床时间: </td> <td align="left"> <input type=" time " name="bed" onblur ="pro()"/> </td> </tr> <tr> <td align="right"> 头像: </td> <td align="left"> <input type=" file " id="f" accept="image/jpeg" onchange ="show()"/><span><img src="/static/imghwm/default1.png" data-src="https://img.php.cn/upload/article/000/001/505/df5c0ac3dda047ee898d7ba5cc22ce28-0.jpg?x-oss-process=image/resize,p_40" class="lazy" id="img" width ="60" height ="60" /></span> <script> function show(){ var file = document.getElementById("f").files[0]; var fileReader = new FileReader(); fileReader.readAsDataURL(file); fileReader. onload = function(){ document.getElementById("img").src = fileReader.result; } } </script> </td> </tr> <tr> <td colspan="2"> <details> <p> 允许注册 <mark> 许可证 </mark>信息 </p> <summary> 注册许可信息 </summary> </details> </td> </tr> <tr> <td align="right"> 验证码 : </td> <td valign="mid dl e"> <input type="text" name="captcha" size="11" maxlength="4" title="输入右边的验证码" /> <span id="span"></span> <script> var span = document.getElementById("span"); span.innerHTML=Math.floor(Math.random()); </script> </td> </tr> <tr height="60px"> <td align="center" colspan="2"> <input type="button" value="转到登录" onclick ="window.location.replace('login.html')" id="btn1" onmousemove ="changeBgColor('btn1')" onmouseout ="recoverBgColor('btn1')" class="submit" /> <input type="submit" accesskey="enter" value="注册" id="btn" onmousemove="changeBgColor('btn')" onmouseout="recoverBgColor('btn');" class="submit" formmethod="post"/> </td> </tr> </table> </td> </tr> </table> </form> </p> </body> </html>
程式碼如下:
body { background-image: url("../images/bg.jpg"); text-align: center; background-repeat: repeat-x; background-position: 0px 0px ; background-size: } .table { border: 1px solid #90BFFF; width:810px; } tr { font-family: 微软雅黑; font-weight:800; color: #448EF3; } input{ border: 1px solid #448EF3; color: #448EF3; font-weight:bold; font-family: "微软雅黑"; height: 35px; line-height: 30px; border-radius:5px; } .submit { width: 150px; height: 40px; cursor :hand; font-size: 20px; color: #ffffff; background-color: #448EF3; border: 0px; } .thead { height: 40px; background : #90BFFF; font-family: "微软雅黑"; font-size: 30px; font-weight: 700; color: #ffffff; background: #90BFFF; } #3{ margin-bottom: 100px; }
程式碼如下:
function ChkAllClick(sonName, cbAllId){ var arrSon = document.getElementsByName(sonName); var cbAll = document.getElementById(cbAllId); var tempState=cbAll.checked; for(i=0;i<arrSon.length;i++) { if(arrSon[i].checked!=tempState) arrSon[i].click(); } } function ChkSonClick(sonName, cbAllId) { var arrSon = document.getElementsByName(sonName); var cbAll = document.getElementById(cbAllId); for(var i=0; i<arrSon.length; i++) { if(!arrSon[i].checked) { cbAll.checked = false; return; } } cbAll.checked = true; } function ChkOppClick(sonName){ var arrSon = document.getElementsByName(sonName); for(i=0;i<arrSon.length;i++) { arrSon[i].click(); } } function changeBgColor(btn){ var btn = document.getElementById(btn); btn.style.backgroundColor = "#90BFFF" } function recoverBgColor(btn){ var btn = document.getElementById(btn); btn.style.backgroundColor = "#448EF3" }
----------------------------------------------- -
上面檔案的順序是:register.html register.css checkbox..js
--------------------- ----------------------------
背景圖片:bg.jpg
【相關推薦】
1. HTML5免費影片教學
4. H5與傳統html的差異
#以上是H5製作一個註冊頁面的程式碼實例的詳細內容。更多資訊請關注PHP中文網其他相關文章!

HTML5的核心特性包括語義化標籤、多媒體支持、離線存儲與本地存儲、表單增強。 1.語義化標籤如、等,提升代碼可讀性和SEO效果。 2.和標籤簡化多媒體嵌入。 3.離線存儲和本地存儲如ApplicationCache和LocalStorage,支持無網絡運行和數據存儲。 4.表單增強引入新輸入類型和驗證屬性,簡化處理和驗證。

H5提供了多種新特性和功能,極大地增強了前端開發的能力。 1.多媒體支持:通過和元素嵌入媒體,無需插件。 2.畫布(Canvas):使用元素動態渲染2D圖形和動畫。 3.本地存儲:通過localStorage和sessionStorage實現數據持久化存儲,提升用戶體驗。

H5和HTML5是不同的概念:HTML5是HTML的一個版本,包含新元素和API;H5是基於HTML5的移動應用開發框架。 HTML5通過瀏覽器解析和渲染代碼,H5應用則需要容器運行並通過JavaScript與原生代碼交互。

HTML5的關鍵元素包括、、、、、等,用於構建現代網頁。 1.定義頭部內容,2.用於導航鏈接,3.表示獨立文章內容,4.組織頁面內容,5.展示側邊欄內容,6.定義頁腳,這些元素增強了網頁的結構和功能性。

HTML5和H5沒有區別,H5是HTML5的簡稱。 1.HTML5是HTML的第五個版本,增強了網頁的多媒體和交互功能。 2.H5常用於指代基於HTML5的移動網頁或應用,適用於各種移動設備。

HTML5是超文本標記語言的最新版本,由W3C標準化。 HTML5引入了新的語義化標籤、多媒體支持和表單增強,提升了網頁結構、用戶體驗和SEO效果。 HTML5引入了新的語義化標籤,如、、、等,使網頁結構更清晰,SEO效果更好。 HTML5支持多媒體元素和,無需第三方插件,提升了用戶體驗和加載速度。 HTML5增強了表單功能,引入了新的輸入類型如、等,提高了用戶體驗和表單驗證效率。

如何寫出乾淨高效的HTML5代碼?答案是通過語義化標籤、結構化代碼、性能優化和避免常見錯誤。 1.使用語義化標籤如、等,提升代碼可讀性和SEO效果。 2.保持代碼結構化和可讀性,使用適當縮進和註釋。 3.優化性能,通過減少不必要的標籤、使用CDN和壓縮代碼。 4.避免常見錯誤,如標籤未閉合,確保代碼有效性。

H5通過多媒體支持、離線存儲和性能優化提升網頁用戶體驗。 1)多媒體支持:H5的和元素簡化開發,提升用戶體驗。 2)離線存儲:WebStorage和IndexedDB允許離線使用,提升體驗。 3)性能優化:WebWorkers和元素優化性能,減少帶寬消耗。


熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

Video Face Swap
使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

熱工具

Safe Exam Browser
Safe Exam Browser是一個安全的瀏覽器環境,安全地進行線上考試。該軟體將任何電腦變成一個安全的工作站。它控制對任何實用工具的訪問,並防止學生使用未經授權的資源。

記事本++7.3.1
好用且免費的程式碼編輯器

SAP NetWeaver Server Adapter for Eclipse
將Eclipse與SAP NetWeaver應用伺服器整合。

SublimeText3漢化版
中文版,非常好用

EditPlus 中文破解版
體積小,語法高亮,不支援程式碼提示功能