会员可以在此提问,百战程序员老师有问必答
对大家有帮助的问答会被标记为“推荐”
看完课程过来浏览一下别人提的问题,会帮你学得更全面
截止目前,同学们一共提了 134190个问题

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <table align="center">
        <tr>
            <td>姓名:</td>
            <td><input type="text"></td>
        </tr>
        <tr>
            <td>密码:</td>
            <td><input type="password"></td>
        </tr>
        <tr>
            <td>确认密码</td>
            <td><input type="password"></td>
        </tr>
        <tr>
            <td>密码提示问题</td>
            <td>
                <form>
                    <select>
                        <option>选择一个答案</option>
                        <option>我的父亲</option>
                        <option>我的母亲</option>
                    </select>
                </form>
            </td>
        </tr>
         <tr>
            <td>密码提示答案</td>
            <td>
                <form>
                    <input type="text" name="" id="">
                </form>
            </td>
        </tr>
        <tr>
            <td>性别:</td>
            <td>
                <form>
                    <input type="radio" name="sex" id="" value="nan">男
                    <input type="radio" name="sex" id="" value="nv">女
                </form>
            </td>
        </tr>
        <tr>
            <td>年龄</td>
            <td>
                <form>
                    <input type="number" name="" id="" max="120" min="0">
                </form>
            </td>
        </tr>
        <tr>
            <td>籍贯:</td>
            <td>
                <form>
                    <select>select>
                        <option>江西</option>
                        <option>广东</option>
                        <option>湖北</option>
                    </select>
                    <select>
                        <option>宜春</option>
                        <option>广州</option>
                        <option>武汉</option>
                    </select>
                </form>
            </td>
        </tr>
        <tr>
            <td>爱好:</td>
            <td>
                <form>
                    <input type="checkbox">sports
                    <input type="checkbox">eats
                    <input type="checkbox">sleep
                </form>
            </td>
        </tr>
        <tr>
            <td>个人介绍:</td>
            <td>
                <form>
                    <textarea cols="30" rows="10"></textarea>
                </form>
            </td>
        </tr>
        <tr>
            <td>上传头像:</td>
            <td>
                <form>
                    <input type="file" name="" id="">
                </form>
            </td>
        </tr>
        <tr>
            <td align="right"></td>
            <td>
                <form action="">
                    <input type="submit" name="" id="">
                    <input type="reset" name="" id="">
                </form>
            </td>
        </tr>
    </table>
</body>

</html>

WEB前端全系列/第一阶段:HTML5+CSS3模块/表单 1楼

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <table border="1" cellspacing="0" width="600px" height="400px" align="center">
        <tr>
            <td colspan="4" align="center">教员搜索</td>
            
        </tr>
        <tr>
            <td>搜索类型</td>
            <td>
                <form action="">
                    <select>
                        <option>选择教员信息</option>
                        <option value="java">java</option>
                        <option value="web">web</option>
                        <option value="py">pathon</option>
                    </select>
                </form>
            </td>
            <td>教员身份</td>
            <td>
                 <form action="">
                    <select>
                        <option value="g">高级教师</option>
                        <option value="z">中级教师/option>
                        <option value="c">初级教师</option>
                    </select>
                </form>
            </td>
        </tr>
        <tr>
            <td>所在地区</td>
            <td>
                 <form action="">
                    <select>
                        <option>不限</option>
                        <option value="bj">北京</option>
                        <option value="sh">上海</option>
                        <option value="gd">广东</option>
                    </select>
                </form>
            </td>
            <td>性别</td>
            <td>
                 <form action="">
                       <input type="radio" name="sex" value="nv">女<br>
                       <input type="radio" name="sex" id="" value="nan">男
                </form>
            </td>
        </tr>
        <tr>
            <td>学习科目</td>
            <td colspan="3">
                  <form action="">
                    <select>
                        <option>在此列表中选择</option>
                        <option value="jc">JavaScript</option>
                        <option value="web">web</option>
                        <option value="py">python</option>
                    </select>
                </form>
            </td>
           
        </tr>
        <tr>
            <td>学习</td>
            <td colspan="3">
                <form >
                    <input type="text" name="" id="" placeholder="请输入要学习的内容">
                </form>
            </td>
           
        </tr>
        <tr>
            <td>专业</td>
            <td colspan="3">请输入所学专业</td><input type="submit" name="" id="" value="提交">
            
        </tr>
    </table>
</body>
</html>

WEB前端全系列/第一阶段:HTML5+CSS3模块/表单 3楼

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>响应式布局实操</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

         body{
            background-color: #f1f1f1;
         }

        .nav {
            width: 100%;
            height: 50px;
            background-color: #555;
            overflow: hidden;
            clear: both;
            line-height: 50px;
        }
        .list{
            width: 80%;
            margin: 0 auto;
            /* list让内容往中间显示 */
        }
        .nav ul{
            overflow: hidden;
            clear: both;
            float: left;
        }

        .container .nav ul li {
            list-style: none;
            float: left;
            padding: 0 20px;
        }

        .container .nav ul li a {
            text-decoration: none;
            color: white;
            font-size: 16px;
        }
        .container .nav ul li.select {
            background-color: orange;
        }

         .nav .search {
            float: right;
            /* position: relative; */
        }

        .container .nav .search input {
            height: 30px;
            width: 200px;
            border: none;
            padding-left: 10px;
            border-radius: 50px;
            display: inline-block;
            /* position: absolute;
            top: 10px;
            right: 100px; */

        }

        .container .nav .search button {
            height: 30px;
            width: 60px;
            border: none;
            border-radius: 50px;
            margin-left: 20px;
            background-color: orange;
            color: white;
            font-size: 16px;
            display: inline-block;
            /* position: absolute;
            top: 10px;
            right: 20px; */
        }
    </style>
</head>

<body>
    <div class="container">
        <div class="nav">
            <div class="list">
                <ul>
                    <li class="select"><a href="#">首页</a></li>
                    <li><a href="#">关于</a></li>
                    <li><a href="#">服务</a></li>
                    <li><a href="#">联系</a></li>
                </ul>
                <div class="search">
                    <input type="text" placeholder="搜索...">
                    <button>搜索</button>
                </div>
            </div>
        </div>
    </div>
    </div>
</body>

</html>

老师,我在搜索框后面加了button按钮,但是搜索框input和button不在一条水平线上,是因为浮动的影响吗?还是我别的地方写错了?我上述代码中注释掉的部分是给父元素search添加了position,然后分别给子元素input搜索框和button添加了绝对定位,解决了这个问题,请问这样做对吗?还有没有其他解决办法使他们的高度齐平image.png

WEB前端全系列/第一阶段:HTML5+CSS3模块/CSS3新特性 5楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/CSS3新特性 7楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/CSS3新特性 8楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/表单 10楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/表单 11楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/表单 12楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/前端入门与基础知识 13楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/前端入门与基础知识 14楼

image.png

WEB前端全系列/第一阶段:HTML5+CSS3模块/前端入门与基础知识 15楼

课程分类

百战程序员微信公众号

百战程序员微信小程序

©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园
网站维护:百战汇智(北京)科技有限公司
京公网安备 11011402011233号    京ICP备18060230号-3    营业执照    经营许可证:京B2-20212637