iOS-html-Login Home Page

综合演练:Login Home Page

3.1 技术点

  • 面板布局
  • 图片居中: vertical-align: middle;
  • 定位
需求

<p>html</p>

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>小码哥登录界面</title>
    <!--导入外部css-->
    <link href="css/index.css" rel="stylesheet">
</head>
<body>
    <!--面板-->
    <div id="panel">
        <!--面板的头部-->
        <div class="panel-header">
            <h2>欢迎登录SeeMyGo教育系统</h2>
        </div>
        <!--面板的中间内容-->
        <div class="panel-content">
           <!--账号输入框-->
           <div class="user-pwd">
               ![](images/icon_people.png)
               <input placeholder="请输入用户名/手机号" name="user">
           </div>
            <!--密码输入框-->
           <div class="user-pwd">
               ![](images/icon_password.png)
               <input placeholder="请输入密码" type="password" name="pwd">
           </div>

            <!--默认的设置-->
            <div class="setting">
               <a href="#"><input type="checkbox"> 下次自动登录</a>
               <a href="#" class="pull-right">忘记密码?</a>
            </div>

            <!--登录按钮-->
            <button class="login-btn">登 录</button>

            <!--立即注册-->
            <div class="reg">
                还没账号?  <a href="#">立即注册</a>
            </div>
        </div>
        <!--面板的尾部-->
        <div class="panel-footer">
             <span>社交账号登录:  </span>
             ![](images/sina.png)
             ![](images/weixin.png)
             ![](images/qq.png)
        </div>
    </div>
</body>
</html>

<p>css</p>

a, address, b, big, blockquote, body, center, cite, code, dd, del, div, dl, dt, em, fieldset, font, form, h1, h2, h3, h4, h5, h6, html, i, iframe, img, ins, label, legend, li, ol, p, pre, small, span, strong, u, ul, var{
    padding: 0;
    margin: 0;
}

a{
    text-decoration: none;
    color: black;
}

body{
    /*设置背景颜色*/
    background: url("../images/bg.png") no-repeat;
    /*设置背景的尺寸*/
    background-size: cover;

    text-align: center;
}

/*面板*/
#panel{
    background-color: white;
    /*改变标签的类型*/
    display: inline-block;
    /*重写*/
    text-align: left;
    /*上边距*/
    margin-top: 150px;
    /*设置内边距*/
    padding: 20px;

    border-radius: 5px;
    box-shadow: -10px 20px 100px black;
}

.panel-header h2{
    font-size: 22px;
    font-weight: normal;
    text-align: center;
    padding-bottom: 12px;
    margin-bottom: 20px;
    /*下划线*/
    border-bottom: 1px solid #dddddd;
}

/*中间的主要内容*/
.panel-content{

}

.panel-content .user-pwd{
   /*background-color: red;*/
   margin-bottom: 15px;
   height: 40px;

   position: relative;
}

.panel-content .user-pwd img{
   position: absolute;
   top: 7px;
   left: 6px;
}

.panel-content .user-pwd input{
   width: 100%;
   height: 100%;
   box-sizing: border-box;
    /*设置内边距*/
   padding-left: 38px;
   border-radius: 5px;
   border:1px solid #dddddd;

}

.panel-content .user-pwd input:focus{
    outline: none;
    border: 1px solid orange;
    box-shadow: 0 0 10px orange;
}

.setting a{
    color: darkgray;
    font-size: 13px;
}

.setting a.pull-right{
    float: right;
}

/*按钮*/
.login-btn{
  margin: 15px 0;
  width: 100%;
  height: 38px;
  background-color: orangered;
  /*去除边框*/
  border: 0;
  font-size: 20px;
  color: white;
  border-radius: 5px;
}

.login-btn:focus{
    outline: none;
}

.reg{
    text-align: center;
    margin-bottom: 15px;
    color: darkgray;
    font-size: 13px;
}

.reg a{
    color: orangered;
}


/*尾部*/
.panel-footer{
    /*background-color: red;*/
    height: 44px;
    line-height: 44px;
}

.panel-footer img{
    width: 30px;
    /*图片居中*/
    vertical-align: middle;
}

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容