form表單,百度注冊(cè)

相當(dāng)于一個(gè)控件集合,里面包含很多控件,點(diǎn)“提交”后會(huì)把表單中的所有控件的值都傳給action到的頁面,form里有一個(gè)method屬性,method有兩個(gè)屬性,分別是 “post” 和 “get”,當(dāng)我們用post時(shí),會(huì)隱藏表單中的所有值,當(dāng)method屬性為 “get”時(shí),可以查看到值,也就是所有值。

廢話不多說,弄一個(gè)例子給大家看看。

<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>百度注冊(cè)</title>
    
        <style type="text/css">
            
            *{
                margin: 0;
                padding: 0;
            }
            .clearfix:after{
                content: '';
                display: block;
                clear: both;
            }
            .clearfix{
                zoom: 1;
            }
            
            
            .box{
                width: 440px;
            }
            .box form{
                width: 100%;
            }
            .form-item{
                
                margin-bottom: 22px;
            }
            .form-item .title{
                width: 80px;
                font-size: 14px;
                color: #666;
                line-height: 40px;
                padding-right: 10px;
                text-align: right;
                float: left;
            }
            .form-item .inp{
                width: 350px;
                height: 40px;
                float: right;
            }
            .form-item .inp input{
                width: 100%;
                height: 100%;
                padding-left: 10px;
                font-size: 13px;
                color: #757575;
            }
            .form-item .inp input.read-inp{
                width: 10px;
                height: 10px;
            }
            .form-item .inp span{
                font-size: 12px;
                color: #666;
            }
            /*.read-content .title{
                height: 15px;
            }
            .read-content .inp{
                height: 15px;
            }*/
            .read-content{
                height: 15px;
            }
            .form-item .inp a{
                color: #1b66c7;
                text-decoration: none;
            }
            .form-item .inp .register-btn{
                width: 350px;
                height: 50px;
                border: none;
                border-radius: 2px;
                background: #3f89ec;
                color: #fff;
            }
        </style>
    
</head>
<body>
    <div class="box">
        <form action="" method="post">
            <div class="form-item clearfix">
                <!-- 用戶名  -->
                <div class="title">
                    <label for="username">
                        用戶名
                    </label>
                </div>
                <div class="inp">
                    <input type="text" name="username" id="username" value="" placeholder="請(qǐng)?jiān)O(shè)置用戶名" />
                </div>
            </div>
            
            <!-- 手機(jī)號(hào) -->
            <div class="form-item clearfix">
                <div class="title">
                    <label for="number">
                        手機(jī)號(hào)
                    </label>
                </div>
                <div class="inp">
                    <input type="text" name="number" id="number" value="" placeholder="可用于登錄和找回密碼" />
                </div>
            </div>
            
            <!-- 驗(yàn)證碼 -->
            <div class="form-item clearfix">
                <div class="title">
                    <label for="checkcode">
                        驗(yàn)證碼
                    </label>
                </div>
                <div class="inp">
                    <input type="text" name="checkcode" id="checkcode" value="" placeholder="請(qǐng)輸入驗(yàn)證碼"/>
                </div>
            </div>
            
            <!-- 密碼 -->
            <div class="form-item clearfix">
                <div class="title">
                    <label for="password">
                        密碼
                    </label>
                </div>
                <div class="inp">
                    <input type="text" name="password" id="password" value="" placeholder="請(qǐng)?jiān)O(shè)置登錄密碼"/>
                </div>
            </div>
            
            <!-- 用戶協(xié)議 -->
            <div class="form-item clearfix read-content">
                <div class="title"></div>
                <div class="inp">
                    <input type="checkbox" name="read" id="read" value="" class="read-inp" />
                    <span>
                        閱讀并接受<a href="#">《百度用戶協(xié)議》</a>及<a href="#">《百度隱私權(quán)保護(hù)聲明》</a>
                    </span>
                </div>
            </div>
            
            <!-- 注冊(cè)按鈕 -->
            <div class="form-item clearfix btn">
                <div class="title"></div>
                <div class="inp">
                    <input type="button" name="btn" id="btn" value="注冊(cè)" class="register-btn" />
                </div>
            </div>
        </form>
    </div>
</body>
</html>
百度注冊(cè).jpg
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • ¥開啟¥ 【iAPP實(shí)現(xiàn)進(jìn)入界面執(zhí)行逐一顯】 〖2017-08-25 15:22:14〗 《//首先開一個(gè)線程,因...
    小菜c閱讀 7,325評(píng)論 0 17
  • Spring Cloud為開發(fā)人員提供了快速構(gòu)建分布式系統(tǒng)中一些常見模式的工具(例如配置管理,服務(wù)發(fā)現(xiàn),斷路器,智...
    卡卡羅2017閱讀 136,551評(píng)論 19 139
  • 本人做php的,最近發(fā)現(xiàn)JS真的是博大精深啊,比PHP難.在HTML中,表單是由form元素來表示的,但是在jav...
    linfree閱讀 2,331評(píng)論 3 17
  • 1.form表單有什么作用?有哪些常用的input 標(biāo)簽,分別有什么作用? HTML 表單用于接收不同類型的用戶輸...
    大胡子歌歌閱讀 976評(píng)論 0 1
  • <input>標(biāo)簽 標(biāo)簽用于搜集用戶信息,根據(jù)不同的type屬性值,輸入字段擁有很多種形式。輸入字段可以是文本字段...
    _空空閱讀 4,189評(píng)論 0 3

友情鏈接更多精彩內(nèi)容