Design a simple HTML login interface using CSS style

Design a simple HTML login interface using CSS style

login.html part:

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title></title>
        <!--Introduce font icon library-->
        <link rel="stylesheet" type="text/css" href="font-awesome-4.7.0/css/font-awesome.min.css">
        <link rel="stylesheet" href="css/reset.css">
        <link rel="stylesheet" href="css/login.css">
    </head>
    <body>

        <div class="wrap">
            <h1>E-Commerce Mall Backend Management System</h1>
            <form action="">
                <div class="input-group">
                    //The icon-like thing on the left side of the input box is a font. //You can download the file font-awesome-4.7.0 from the Internet and paste it directly into the project directory for use <i class="icon-user fa fa-user"></i>
                    <input type="text" name="" class="form-control" placeholder="Please enter your username">
                </div>
                <div class="input-group">
                    <i class="icon-user fa fa-lock"></i>
                    <input type="password" name="" class="form-control" placeholder="Please enter your password">
                </div>
                <div class="input-group btn-group">
                    <button>Login</button>
                </div>
            </form>
            <p>&copy;xx Group&nbsp;All rights reserved</p>
        </div>

    </body>
</html>

reset.css part (reset part)

*{
 margin:0;
 padding:0;
}
a{
 font-size: 12px;
 text-decoration: 0;
 color:#222;
}
a,
input,
button{
 outline: none;
}
ul,ol,li{
 list-style: none;
}
h1,h2,h3,h4,h5,h6{
 font-weight: 100;
}
img{
 display: block;
 border: 0;
}

About resetting the style file:

Because different browsers render HTML tags differently, even if the developer does not write a line of CSS code for the HTML page, the opened page will always have a style, but the default styles of different browsers are slightly different, which creates trouble for developers to a certain extent. Therefore, before starting to write CSS code, the style sheet is usually reset first to unify the styles of HTML elements in all browsers. Front-end engineers unify the styles through custom style files, thereby improving the compatibility of the front-end interface.

login.css part

y{
 background: rgba(0,0,0,0.8);
}
body{
    //Set the background image for the web page background-image: url(../img/xx.jpg);
}
.wrap{
    //Center the main body of the interface in the browser position: absolute; //Absolute positioning left: 50%;
 top: 50%;
 margin: -175px 0 0 -250px;
 padding: 20px;
 width: 500px;
 height: 350px;
 background: #333333;
 box-shadow:0 0 10px rgba(255,255,255,0.5);
 box-sizing: border-box; //padding and border are included in the defined width and height}
h1{
 height: 50px;
 font-size: 1.6em;
 text-align: center;
 border-bottom: 1px solid rgba(255,255,255,0.5);
}
.input-group{
 margin: 20px auto;
 height: 40px;
 width: 300px;
 border: 1px solid rgba(0,0,0,0.2);
}
i{
 float: left; //left float width: 40px;
 height: 40px;
 text-align: center;
 line-height: 40px !important;
 background: rgb(22,160,93);
 color: #fff;
 font-size: 22px !important;
 
}
.form-control{
 float: left;
 padding: 0 10px;
 height: 40px;
 border: 0;
 width: 260px;
 font-size: 18px;
 box-sizing: border-box;
}
.btn-group{
 border: 0;
 margin-top: 40px;
}
button{
 display: block;
 width: 100%;
 height: 40px;
 font-size: 1.2em;
 letter-spacing: 10px;
 border: 1px solid rgb(22,160,93);
 color: rgb(22,160,93);
 background: #fff;
 cursor: pointer;
}
button:hover{
    //Set the dynamic effect color of mouse hover for button elements: #fff;
 background: rgb(22,160,93);
}
p{
 font-size: 12px;
 text-align: center;
 color: #888;
}

The effect of the design results on the browser:

This is the end of this article about how to use CSS styles to design a simple HTML login interface. For more relevant CSS HTML login interface content, please search 123WORDPRESS.COM’s previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future!

<<:  A brief discussion on the definition and precautions of H tags

>>:  How to display percentage and the first few percent in MySQL

Recommend

Installation method of MySQL 5.7.18 decompressed version under Win7x64

Related reading: Solve the problem that the servi...

How to use libudev in Linux to get USB device VID and PID

In this article, we will use the libudev library ...

MySql 5.6.35 winx64 installation detailed tutorial

Note: There was no error in the project startup d...

JavaScript array reduce() method syntax and example analysis

Preface The reduce() method receives a function a...

Summary of B-tree index knowledge points in MySQL optimization

Why do we need to optimize SQL? Obviously, when w...

How to install and configure SSH service in Ubuntu 18.04

Install ssh tool 1. Open the terminal and type th...

Analysis of parameter transfer process of driver module in Linux

Declare the parameter name, type and permission y...

Alibaba Cloud ESC Server Docker Deployment of Single Node Mysql

1. Download the accelerated version of msyql dock...

How to set a dotted border in html

Use CSS styles and HTML tag elements In order to ...

HTML 5 Preview

<br />Original: http://www.alistapart.com/ar...

HTML table markup tutorial (6): dark border color attribute BORDERCOLORDARK

In a table, you can define the color of the lower...

Canvas draws scratch card effect

This article shares the specific code for drawing...

Summary of common operation skills of MySQL database

This article summarizes common operating techniqu...

Vue method to verify whether the username is available

This article example shares the specific code of ...

Detailed explanation of command to view log files in Linux environment

Table of contents Preface 1. cat command: 2. more...