search
HomeWeb Front-endCSS TutorialShare the cool login page code implemented in HTML and CSS
Share the cool login page code implemented in HTML and CSSOct 24, 2018 am 10:03 AM
csshtmllog in page

Have you noticed when browsing websites that almost every website requires you to register or log in? As a front-end developer, do you know how to make an HTML login page? This article will share with you a cool login page code implemented by HTML and CSS. It has certain practical value. Interested friends can refer to it.

To make this cool login page, you need to use many attributes in CSS, such as box-shadow, display attribute, border-radius rounded corner, hover pseudo-class, etc. If you are unclear, you can read it Read my previous articles, or visit CSS video tutorial, I hope it can help you!

Instance description: Create a cool HTML and CSS login page. When information is entered in the input box, the color of the input box becomes lighter. It also has functions of remembering passwords, forgetting passwords, and logging in. The specific code is as follows:

HTML part:

<div class="wrapper">
      <div class="header">登录页面</div>
      <form action="" method="post">
          <ul>
              <li>
                  <div class="text">
                      <span class="yonghu"></span><input type="text" placeholder="请输入用户名">
                  </div>
              </li>
              <li>
                  <div class="password">
                      <span class="mima"></span><input type="password" placeholder="请输入密码">
                  </div>
              </li>
              <li class="remember">
                  <input type="checkbox">记住密码
              </li>
              <li>
                  <a href="">忘记密码</a>
              </li>
              <li>
                  <input type="button" value="登陆">
              </li>
          </ul>
      </form>      
  </div>

CSS part:

@font-face {
       font-family: &#39;iconfont&#39;;
       src: url(&#39;//at.alicdn.com/t/font_1463147324_946932.eot&#39;); /* IE9*/
       src: url(&#39;//at.alicdn.com/t/font_1463147324_946932.eot?#iefix&#39;) format(&#39;embedded-opentype&#39;), /* IE6-IE8 */
       url(&#39;http://at.alicdn.com/t/font_1463147324_946932.woff&#39;) format(&#39;woff&#39;), /* chrome、firefox */
       url(&#39;http://at.alicdn.com/t/font_1463147324_946932.ttf&#39;) format(&#39;truetype&#39;), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/
       url(&#39;//at.alicdn.com/t/font_1463147324_946932.svg#iconfont&#39;) format(&#39;svg&#39;); /* iOS 4.1- */
   }   
   *{margin: 0;padding: 0}
   li{list-style: none;}
   form a{text-decoration: none;}
   html,body {
       background: #fff;
       width: 100%;
       height: 100%;
       display: flex;
       flex-flow: column nowrap;
       justify-content: center;
   }
   .wrapper{text-align: center;}
   .header{
       font-size: 25px;
       font-family: 微软雅黑;
       color: rgb(98,94,91);
   }   
   form{
       background: url(input-bg.png);
       width: 260px;
       height: 260px;
       margin: 35px auto;
       padding: 30px;
       box-shadow:0px 1px 2px 1px #aaaaaa,
       inset 0px 1px 1px rgba(255,255,255,0.7);
       border-radius: 3px;
   }
   form ul{
       width: 100%;
       height: 100%;
       text-align: left;
       display: flex;
       flex-flow: column nowrap;
       justify-content: space-between;
   }
   ul li div{
       width: 260px;
       height: 40px;
       background: #e1dcd8;
       color: rgb(98,94,91);
       box-shadow: inset 0px 2px 5px #aaaaaa;
       border-radius: 5px;
       position: relative;
   }
   ul li .yonghu{
       font-family: iconfont;
       position: absolute;
       top: 12px;
       left: 10px;
   }
   ul li .mima{
       font-family: iconfont;
       position: absolute;
       top: 12px;
       left: 10px;
   }
   ul li div input{
       height: 40px;
       width: 190px;
       padding: 0 35px;
       border: none;
       background: #e1dcd8;
       color: rgb(98,94,91);
       box-shadow:
               0px 1px 1px rgba(255,255,255,0.7),
               inset 0px 2px 5px #aaaaaa;
       border-radius: 5px;
   }
   ul li input:focus{
       outline: none;
       background: #f5f2ef;
   }
   ul .remember{
       font-size: 14px;
       font-family: 微软雅黑;
       font-weight: bold;
       color: rgb(98,94,91);
       position: relative;
       display: flex;
       justify-content: center;
   }
   ul .remember input[type*="checkbox"]{
       width: 20px;
       height: 20px;
       vertical-align: super;
       margin-right: 12px;
   }
   .remember label {
       cursor: pointer;
       position: absolute;
       width: 22px;
       height: 22px;
       top: 7px;
       left: 0;
       background: #eee;
       border:1px solid #cccccc;
       border-radius: 4px;
   
   }
   /*Display the tick inside the checkbox*/
   .remember label:after {
       opacity: 0.4;
       content: &#39;&#39;;
       position: absolute;
       width: 12px;
       height: 5px;
       background: transparent;
       top: 6px;
       left: 4px;
       border: 3px solid #74884a;
       border-top: none;
       border-right: none;
   
       -webkit-transform: rotate(-45deg);
       -moz-transform: rotate(-45deg);
       -o-transform: rotate(-45deg);
       -ms-transform: rotate(-45deg);
       transform: rotate(-45deg);
   }
   /*Create the hover event of the tick*/
   .remember label:hover::after {
       opacity: 0.7;
   }
   /*Create the checkbox state for the tick*/
   .remember input[type=checkbox]:checked + label:after {
       opacity: 1;
       border-color: #74884a;
   }
   ul li a{
       font-size: 14px;
       font-family: 黑体;
       color: rgb(152,142,135);
       display: flex;
       justify-content: center;
   }
   ul li input[type*="button"]{
       width: 100%;
       height: 40px;
       font-family: Arial, Helvetica, sans-serif;
       font-size: 18px;
       color: #ffffff;
       background: -moz-linear-gradient(
               top,
               #94aa64 0%,
               #7a924a 50%,
               #607738);
       background: -webkit-gradient(
               linear, left top, left bottom,
               from(#94aa64),
               color-stop(0.50, #7a924a),
               to(#607738));
       -moz-border-radius: 5px;
       -webkit-border-radius: 5px;
       border-radius: 5px;
       border: 1px solid #7d8862;
       -moz-box-shadow:
               0px 1px 0px rgba(170,170,170,1),
               inset 0px 1px 1px rgba(255,255,255,0.7);
       -webkit-box-shadow:
               0px 1px 0px rgba(170,170,170,1),
               inset 0px 1px 1px rgba(255,255,255,0.7);
       box-shadow:
               0px 1px 0px rgba(170,170,170,1),
               inset 0px 1px 1px rgba(255,255,255,0.7);
       text-shadow:
               0px -1px 0px rgba(000,000,000,0.3),
               0px 0px 0px rgba(255,255,255,0);
   }
   ul li input[type*="button"]:hover{
       opacity: 0.8;
   }
   ul li input[type*="button"]:active{
       width: 100%;
       height: 40px;
       font-family: Arial, Helvetica, sans-serif;
       font-size: 18px;
       color: #ffffff;
       background: -moz-linear-gradient(
               top,
               #607738 0%,
               #7a924a 50%,
               #94aa64 );
       background: -webkit-gradient(
               linear, left top, left bottom,
               from(#607738),
               color-stop(0.50, #7a924a),
               to(#94aa64));
       -moz-border-radius: 5px;
       -webkit-border-radius: 5px;
       border-radius: 5px;
       border: 1px solid #7d8862;
       -moz-box-shadow:
               0px -1px 0px rgba(170,170,170,1),
               inset 0px -1px 1px rgba(255,255,255,0.7);
       -webkit-box-shadow:
               0px -1px 0px rgba(170,170,170,1),
               inset 0px -1px 1px rgba(255,255,255,0.7);
       box-shadow:
               0px -1px 0px rgba(170,170,170,1),
               inset 0px -1px 1px rgba(255,255,255,0.7);
       text-shadow:
               0px 1px 0px rgba(000,000,000,0.3),
               0px 0px 0px rgba(255,255,255,0);
   }

The effect is as shown in the picture:

Share the cool login page code implemented in HTML and CSS

The above has shared with you the cool login page code implemented by HTML and CSS. It may be difficult for beginners. This example is a comprehensive application of HTML and CSS knowledge, so you must lay a solid foundation. I hope This tutorial will help you!

【Recommended related tutorials】

1. HTML tutorial
2. CSS3 tutorial
3. bootstrap tutorial

The above is the detailed content of Share the cool login page code implemented in HTML and CSS. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
HTML超文本标记语言--超在那里?(文档分析)HTML超文本标记语言--超在那里?(文档分析)Aug 02, 2022 pm 06:04 PM

本篇文章带大家了解一下HTML(超文本标记语言),介绍一下HTML的本质,HTML文档的结构、HTML文档的基本标签和图像标签、列表、表格标签、媒体元素、表单,希望对大家有所帮助!

html和css算编程语言吗html和css算编程语言吗Sep 21, 2022 pm 04:09 PM

不算。html是一种用来告知浏览器如何组织页面的标记语言,而CSS是一种用来表现HTML或XML等文件样式的样式设计语言;html和css不具备很强的逻辑性和流程控制功能,缺乏灵活性,且html和css不能按照人类的设计对一件工作进行重复的循环,直至得到让人类满意的答案。

web前端笔试题库之HTML篇web前端笔试题库之HTML篇Apr 21, 2022 am 11:56 AM

总结了一些web前端面试(笔试)题分享给大家,本篇文章就先给大家分享HTML部分的笔试题(附答案),大家可以自己做做,看看能答对几个!

总结HTML中a标签的使用方法及跳转方式总结HTML中a标签的使用方法及跳转方式Aug 05, 2022 am 09:18 AM

本文给大家总结介绍a标签使用方法和跳转方式,希望对大家有所帮助!

HTML5中画布标签是什么HTML5中画布标签是什么May 18, 2022 pm 04:55 PM

HTML5中画布标签是“<canvas>”。canvas标签用于图形的绘制,它只是一个矩形的图形容器,绘制图形必须通过脚本(通常是JavaScript)来完成;开发者可利用多种js方法来在canvas中绘制路径、盒、圆、字符以及添加图像等。

html中document是什么html中document是什么Jun 17, 2022 pm 04:18 PM

在html中,document是文档对象的意思,代表浏览器窗口的文档;document对象是window对象的子对象,所以可通过“window.document”属性对其进行访问,每个载入浏览器的HTML文档都会成为Document对象。

html5废弃了哪个列表标签html5废弃了哪个列表标签Jun 01, 2022 pm 06:32 PM

html5废弃了dir列表标签。dir标签被用来定义目录列表,一般和li标签配合使用,在dir标签对中通过li标签来设置列表项,语法“<dir><li>列表项值</li>...</dir>”。HTML5已经不支持dir,可使用ul标签取代。

Html5怎么取消td边框Html5怎么取消td边框May 18, 2022 pm 06:57 PM

3种取消方法:1、给td元素添加“border:none”无边框样式即可,语法“td{border:none}”。2、给td元素添加“border:0”样式,语法“td{border:0;}”,将td边框的宽度设置为0即可。3、给td元素添加“border:transparent”样式,语法“td{border:transparent;}”,将td边框的颜色设置为透明即可。

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.