响应式设计

在这个页面中,使用下面3点来完成响应式设计

1、最大宽度 .设定了一个 max-width 的最大宽度,以便在大屏幕时兼容.;

2、margin : 30px auto; 使其保持时刻居中;

3、输入用户名,密码时需要将元素上移20px,使其为触发状态,并使字体缩小4px;

4、内容主色调采用#18B4ED;

DEMO页面Html:

<div class="container    <div class="logo">

        <div class="logo-block-top">
</div>
<div class="logo-block-bottom">
<div id="FiveStar"></div>
</div>
</div>
<h4 class="login-header">用户登录</h4>
<div class="content">
<div class="form-group">
<input type="text" required class="form-control">
<label class="form-label">用户名</label>
</div>
<div class="form-group">
<input type="password" required class="form-control">
<label class="form-label">密 码</label>
</div>
</div>
</div>

DEMO对应的CSS样式:

给 整体body 添加样式:

body,html {
font-family: "Microsoft Ya Hei";
background-color: #18b4ed;
color: #777;
}

登录模块版心样式:

.container{
position: relative;
backface-visibility: hidden;
max-width: 360px;
margin: 30px auto;
padding: 45px 20px;
border-radius: 4px;
box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
background-color: #fff;
box-sizing: border-box;
}

头部logo背景的样式(应用伪类:after属性):

.container>.logo {
height: 150px;
width: 150px;
position: relative;
background-color: #EFEFEF;
border-radius: 75px;
margin: 0 auto;
}
.container>.logo::after {
content: “”;
height: 150px;
width: 75px;
position: absolute;
background-color: #E1E1E1;
border-radius: 0 75px 75px 0;
left: 75px;
top: 0;
}

接下来就是添加logo:

.container>.logo>.logo-block-top {
box-sizing: border-box;
height: 45px;
width: 54px;
border: 10px solid #E6E6FA;
border-bottom: 0;
position: absolute;
border-radius: 27px 27px 0 0;
left: 48px;
z-index: 1001;
top: 20px;
}
.container>.logo>.logo-block-bottom {
position: absolute;
height: 60px;
width: 80px;
box-sizing: border-box;
background-color: #FFA000;
z-index: 1001;
top: 65px;
left: 35px;
border-radius: 7px;
}
.FiveStar {
width: 0;
height: 0;
float: left;
margin: 20px;
color: #ff0012;
position: relative;
border-right: 20px solid transparent;
border-bottom: 15px solid #ff0012;
border-left: 20px solid transparent;
transform: rotate(35deg);
}
.FiveStar:before {
height: 0;
width: 0;
content: '';
position: absolute;
top: -11px;
left: -12px;
border-bottom: 15px solid #ff0012;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
transform: rotate(-35deg);
}
.FiveStar:after {
width: 0;
height: 0;
content: '';
position: absolute;
top: 0;
left: -20px;
color: #ff0012;
border-right: 20px solid transparent;
border-bottom: 15px solid #ff0012;
border-left: 20px solid transparent;
transform: rotate(-70deg);
}

页面文本提示:

.container>.login-title {
text-align: center;
font-size: 22px;
color: #18b4ed;
font-weight: 200;
margin: 15px 0 18px 0;
}

用户登录input框应用:

.container>.content {
width: 90%;
margin: 0 auto;
}
.container>.content>.form-group {
position: relative;
}
.container>.content>.form-group>.form-control {
z-index: 3;
position: relative;
height: 58px;
width: 100%;
border: 0;
border-bottom: 1px solid #777;
padding-top: 22px;
color: #18b4ed;
font-size: 12px;
background: none;
box-sizing: border-box;
outline: none;
display: inline-block;
-webkit-transition: 0.3s;
transition: 0.3s;
}
.container>.content>.form-group>.form-label {
z-index: 1;
position: absolute;
bottom: 10px;
left: 0;
font-size: 15px;
-webkit-transition: 0.3s;
transition: 0.3s;
}
.container>.content>.form-group>:first-child {
margin-bottom: 5px;
}

添加input触发效果:

.container>.content>.form-group>.form-control:focus,
.container>.content>.form-group>.form-control:valid {
box-shadow: 0 1px #18b4ed;
border-color: #18b4ed;
} .container>.content>.form-group>.form-control:focus+.form-label,
.container>.content>.form-group>.form-control:valid+.form-label {
font-size: 12px;
-ms-transform: translateY(-20px);
-webkit-transform: translateY(-20px);
transform: translateY(-25px);
}

至此,一个简单的DEMO登录页就完成!

使用CSS3制作首页登录界面实例的更多相关文章

  1. 使用Axure RP原型设计实践03,制作一个登录界面的原型

    本篇体验做一个登录界面的原型. 登录页 首先在Page Style里为页面设置背景色. 如果想在页面中加图片,就把Image部件拖入页面,并设置x和y轴.双击页面中的Image部件可以导入图片.在Im ...

  2. 采用CSS3设计的登录界面,动态效果(动画)

    与上一篇的“采用CSS3设计的登陆界面”的相同,只是样式style添加了CSS3的动画元素. style内容如下: <style> html,body,div{ margin:0; pad ...

  3. java 制作QQ登录界面

    package org.eclipse.wb.swing; import java.awt.BorderLayout;import java.awt.EventQueue; import javax. ...

  4. 制作用户登录界面(JAVA实现)

    设计实现如图所示的个人信息注册.包含单选按钮.多选按钮.下拉框事件. Zuoye类: package example02; import java.awt.event.ActionEvent; imp ...

  5. Axure实例演示—登录界面

         实例演示 ——登录界面                                                                                    ...

  6. jQuery和CSS3炫酷GOOGLE样式的用户登录界面

    这是一款使用jQuery和CSS3打造的GOOGLE样式的用户登录界面特效.该登录界面特效中,右上角的小问号和错误提示小图标使用SVG来制作.username和password输入框採用浮动标签特效. ...

  7. Android开发实例之miniTwitter登录界面的实现

    原文: http://www.jizhuomi.com/android/example/134.html 本文要演示的Android开发实例是如何完成一个Android中的miniTwitter登录界 ...

  8. 图解CSS3制作圆环形进度条的实例教程

    圆环形进度条制作的基本思想还是画出基本的弧线图形,然后CSS3中我们可以控制其旋转来串联基本图形,制造出部分消失的效果,下面就来带大家学习图解CSS3制作圆环形进度条的实例教程 首先,当有人说你能不能 ...

  9. 运用HTML5+CSS3和CSS滤镜做的精美的登录界面

    原始出处http://chenjinfei.blog.51cto.com/2965201/774865 <!DOCTYPE HTML> <html> <head> ...

随机推荐

  1. JavaScript中8个容易犯的错误

    这里dbestech针对JavaScript初学者给出一些技巧和列出一些陷阱. 1. 你是否尝试过对数组元素进行排序? JavaScript默认使用字典序(alphanumeric)来排序.因此,[1 ...

  2. 使用版本 1.0.0 的 Azure ARM SDK for Java 创建虚拟机时报错

    问题描述 我们可以通过使用 Azure ARM SDK 来管理 Azure 上的资源,因此我们也可以通过 SDK 来创建 ARM 类型的虚拟机,当我们使用 1.0.0 版本的 Azure SDK fo ...

  3. MongoDB数据库 备份 还原

    MongoDB数据库 1.备份用        mongodump 2.还原用        mongorestore 1.备份 @echo offecho 正在备份MongoDB数据库SET mon ...

  4. Vue2自定义指令改变DOM值后未刷新data中绑定属性的值

    标签(空格分隔): Vue 自定义指令用于过滤输入框,只允许输入数字: Vue.directive('numberOnly', { bind: function (el, binding) { el. ...

  5. How to reference two table when lack reference column.

    Question:How to reference two table when lack reference column. Example: 1.Create two tables the one ...

  6. IOS Core Motion、UIAccelerometer(加速计使用)

    加速计 ● 加速计的作用 ● 用于检测设备的运动(比如摇晃) ● 加速计的经典应用场景 ● 摇一摇 ● 计步器 ● 加速计程序的开发 ● 在iOS4以前:使用UIAccelerometer,用法非常简 ...

  7. Java之生成条形码、PDF、HTML

    关于Java生成HTML,可参考我的这篇文章:FreeMarker之根据模型生成HTML代码 当然了,该篇文章也会给你很多启发,比如,根据html生成html,大家不要小看这个,著名的WordPres ...

  8. win10 安装YII2

    YII2下载地址:http://www.yiichina.com/download 高级版本和基本版本的区别是: 基础版只有一个只有一个web应用,高级版则生成前后台.建议使用高级版,方便 Yii2框 ...

  9. Laravel5 打印SQL

    在src/Illuminate/Database/Connection.php里打印SQL默认是关闭的,见https://github.com/laravel/framework/commit/e0a ...

  10. mysql 综合

    一.库操作 二.表操作 1.存储引擎介绍 show engines; 查看数据库支持的引擎 MySQL 使用 InnoDB 指定表类型/存储引擎 create table t1(id int)engi ...