基础的表单

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        * {
            margin:0;
            padding: 0;
        }
        form > div {
            margin-top: 10px;
        }
    </style>
</head>
<body>
<form>
    <div>
        用户:
        <input type="text" name="user" id="user" maxlength="8" placeholder="请输入用户名">
    </div>
    <div>
        密码:
        <input type="password" id="password" name="password" placeholder="请输入密码">
    </div>
    <div>
        <label for="men">男
            <input type="radio" id="men" name="sex" value="man" checked>
        </label>
        <label for="women">女
            <input type="radio" id="women" name="sex" value="women">
        </label>
    </div>
    <div>
        <label for="yao"><input type="checkbox" id="yao" name="nbaStar" value="a">姚明</label>
        <label for="kobe"><input type="checkbox" id="kobe" name="nbaStar" value="b">科比</label>
        <label for="harden"><input type="checkbox" id="harden" name="nbaStar" value="c">哈登</label>
        <label for="james"><input type="checkbox" id="james" name="nbaStar" value="d">詹姆斯</label>
        <br>
        <input type="button" value="提交答案">
    </div>
    <select>
        <option>选择优惠券</option>
        <option value="优惠卷1" selected>优惠卷1</option>
        <option value="优惠卷2">优惠卷2</option>
        <option value="优惠卷3">优惠卷3</option>
    </select>

    <div>
        <textarea name="textarea" id="" cols="30" rows="10">d</textarea>
    </div>
    <div>
    <input type="submit" name="" value="提交">
    <input type="button" name="" value="普通按钮">
    <input type="reset" name="" value="重置">
    </div>
</form>
</body>
</html>

猜你喜欢

转载自blog.csdn.net/onepunchmen00/article/details/88546480