HTML+CSS综合练习

HTML+CSS综合练习_第1张图片

 

 

 

DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Titletitle>
    <style>
        * {
            margin: 0px;
            padding: 0px;
            box-sizing: border-box;
        }

        body {
            background: url("img/register_bg.png");
            padding: 30px;
        }

        .BigBox {
            width: 900px;
            height: 500px;
            border: 8px solid #EEEEEE;
            background-color: white;
            /*让div水平居中*/
            margin: auto;
        }

        /**/
        .left_layout {
            margin: 15px;
            float: left;
        }

        #txt_reg1 {
            color: #FFD026;
            font-size: 20px;

        }

        #txt_reg2 {
            color: #A6A6A6;
            font-size: 22px;
        }

        /**/
        .center_layout {
            float: left;
            margin: 15px;
        }

        .center_layout table {
            /*合并边框模型*/
            border-collapse: separate;
            /*相邻单元的边框之间的距离*/
            border-spacing: 2px;
            border-color: gray;
        }

        .td_left {
            width: 100px;
            text-align: right;
            height: 45px;
        }

        .td_right {
            padding-left: 50px;
        }

        #username, #password, #email, #name, #tel, #birthday, #verify_code {
            width: 250px;
            height: 32px;
            border: 1px solid #A6A6A6;
            border-radius: 5px;
            padding-left: 10px;
        }

        #verify_code {
            width: 110px;
        }

        #img_verify_code {
            height: 32px;
            /*垂直居中*/
            vertical-align: middle;
        }

        #btn_submit {
            width: 130px;
            height: 40px;
            background-color: #FFD026;
            border: 1px solid #FFD026;
        }

        /**/
        .right_layout {
            float: right;
            margin: 15px;
        }

        a:link {
            color: pink;
        }

        a:hover {
            color: green;
        }

        a:active {
            color: yellow;
        }

        a:visited {
            color: red;
        }

        .right_layout div {
            float: left;
        }
    style>
head>
<body>
<div class="BigBox">
    
    <div class="left_layout">
        <div id="txt_reg1">新用户注册div>
        <div id="txt_reg2">USER REGISTERdiv>
    div>
    
    <div class="center_layout">
        
        <form action="#" method="post">
            <table>
                <tbody>
                <tr>
                    <td class="td_left">
                        <label for="username">用户名label>
                    td>
                    <td class="td_right">
                        <input type="text" name="username" id="username" placeholder="请输入用户名">
                    td>
                tr>

                <tr>
                    <td class="td_left">
                        <label for="password">密码label>
                    td>
                    <td class="td_right">
                        <input type="password" name="password" id="password" placeholder="请输入密码">
                    td>
                tr>

                <tr>
                    <td class="td_left">
                        <label for="email">Emaillabel>

                    td>
                    <td class="td_right">
                        <input type="email" name="email" id="email" placeholder="请输入邮箱">
                    td>
                tr>

                <tr>
                    <td class="td_left">
                        <label for="name">姓名label>
                    td>
                    <td class="td_right">
                        <input type="text" name="name" id="name" placeholder="请输入姓名">
                    td>
                tr>

                <tr>
                    <td class="td_left">
                        <label for="tel">手机号label>
                    td>
                    <td class="td_right">
                        <input type="text" name="tel" id="tel" placeholder="请输入手机号">
                    td>
                tr>

                <tr>
                    <td class="td_left">
                        <label>性别label>
                    td>
                    <td class="td_right">
                        <input type="radio" name="gender" value="male" checked><input type="radio" name="gender" value="female">td>
                tr>

                <tr>
                    <td class="td_left">
                        <label for="birthday">出生日期label>
                    td>
                    <td class="td_right">
                        <input type="date" name="birthday" id="birthday">
                    td>
                tr>

                <tr>
                    <td class="td_left">
                        <label for="verify_code">验证码label>
                    <td class="td_right">
                        <input type="text" name="verify_code" id="verify_code">
                        <img src="img/verify_code.jpg" id="img_verify_code">
                    td>
                tr>
                <tr>
                    <td colspan="2" align="center">
                        <input type="submit" value="注册" id="btn_submit">
                tr>

                tbody>
            table>
        form>
    div>
    
    <div class="right_layout">
        <div>已有账号?div>
        <div><a href="#">立即登录a>div>

    div>
div>
body>
html>

 

你可能感兴趣的:(HTML+CSS综合练习)