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

内联式可以不用加type=text?css吗?

但是我下面的这样也是可以运行的欸,用的还比较多

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <title>Title</title>

</head>

<style type="text/css">

    *{

        margin: 0;

        padding: 0;

        text-decoration: none;

        box-sizing: border-box;

    }

    body{

        min-height: 100vh;

        background-color: skyblue;

    }

    .login-box{

        width: 360px;

        background: #fff;

        height: 580px;

        padding: 80px 40px;

        border-radius: 10px;

        position: absolute;

        left: 50%;

        top:50%;

        transform: translate(-50%,-50%);

    }

    .login-box h1{

        text-align: center;

        margin-bottom: 60px;


    }

    .txtb{

        position: relative;

        margin: 30px 0;

    }

    .txtb input{

        width: 280px;

        height: 50px;

        border: 1px solid #bbb;

        border-radius: 5%;

    }

    .txtb select{

        width: 200px;

        height: 25px;

        border: 1px solid #bbb;

        border-radius: 5%;

    }

    .logbtn{

        display: block;

        width: 100%;

        height: 50px;

        border: none;

        font-size: 20px;

        background-size: 200%;

        background-color: #ff6300;

        outline: none;

        cursor: pointer;

        transition: .5s;

    }

    .logbtn:hover{

        background-position: right;

    }

    .bottom-text{

        margin-top: 60px;

        text-align: center;

        font-size: 13px;

       

    }


</style>

<body>

<form action="LoginServlet" method="post" class="login-box" >

    <h1>宿舍管理系统</h1>

    <div class="txtb">

        <input type="text" name="username"><br/>

    </div>

    <div class="txtb">

        <input type="password" name="password"><br/>

    </div>

    <div class="txtb">

        <p>你选择登录的身份是?</p>

        <select>

            <option>学生</option>

            <option>老师</option>

            <option>宿舍管理员</option>

        </select>

    </div>

    <input type="submit" class="logbtn" value="提交">


    <div class="bottom-text">


    </div>


</form>

</body>

</html>



WEB前端全系列/第一阶段:HTML5+CSS3模块/初识CSS 302楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/表单 303楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/表单 304楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/表单 305楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/商城官网项目 307楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/浮动与定位 308楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/响应式项目 313楼
WEB前端全系列/第一阶段:HTML5+CSS3模块/浮动与定位 315楼

课程分类

百战程序员微信公众号

百战程序员微信小程序

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