How to design form login HTML CSS

How to design form login HTML CSS


index.html with improved structure and some small fixes. The HTML, CSS, and JS are properly linked to enhance functionality and design. I also made a few optimizations:

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Login Form Design</title> <!-- Bootstrap CSS and JS --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script> <!-- Font Awesome --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.0.3/css/font-awesome.css"> <!-- Custom CSS --> <link rel="stylesheet" href="styles.css"> </head> <body> <div class="container px-4 py-5 mx-auto"> <div class="card card0"> <div class="d-flex flex-lg-row flex-column-reverse"> <!-- Login Form Section --> <div class="card card1"> <div class="row justify-content-center my-auto"> <div class="col-md-8 col-10 my-5"> <h3 class="mb-5 text-center heading">Soeng Souy</h3> <h6 class="msg-info text-center">Please login to your account</h6> <form> <div class="form-group"> <label class="form-control-label text-muted">Username</label> <input type="text" id="email" name="email" placeholder="Enter email" class="form-control"> </div> <div class="form-group"> <label class="form-control-label text-muted">Password</label> <input type="password" id="psw" name="psw" placeholder="Enter password" class="form-control"> </div> <div class="row justify-content-center my-3 px-3"> <button type="submit" class="btn-block btn-color">LOG IN</button> </div> <div class="row justify-content-center my-2"> <a href="#"><small class="text-muted">Forgot Password?</small></a> </div> </form> </div> </div> </div> <!-- Info Section --> <div class="card card2"> <div class="my-auto mx-md-5 px-md-5 right"> <h3 class="text-white">SoengSouy Webdesign</h3> <small class="text-white"> SoengSouy.Webdesign is a free online learning program that teaches web development skills, including HTML, CSS, Javascript, PHP, and more. </small> </div> </div> </div> </div> </div> </body> </html>

Key Updates:

  1. HTML Structure: The HTML structure remains mostly the same, with clear organization and comments to separate sections for the login form and the info section.

  2. Form Elements: The login form contains text fields for username and password, with the submit button. Each form element has been neatly structured with Bootstrap classes for a responsive design.

  3. Info Section: This contains the description of "SoengSouy Webdesign" with white text on a gradient background.

  4. External Libraries: I used Bootstrap and Font Awesome libraries to ensure responsiveness and icons. These libraries are hosted externally.

  5. Custom CSS: The styles are still linked to a separate styles.css file.

Here is your styles.css again with some improvements:

body { color: rgb(190, 188, 188); } .flex-lg-row { display: flex; flex-direction: row; box-shadow: 10px 10px 15px 15px #aaaaaa; } input, textarea { background-color: #F3E5F5; border-radius: 1px !important; padding: 12px 15px; width: 100%; box-sizing: border-box; border: none !important; font-size: 16px !important; color: #000 !important; } input:focus, textarea:focus { box-shadow: none !important; border: 1px solid #D500F9 !important; outline-width: 0; } button:focus { box-shadow: none !important; outline-width: 0; } .card { border-radius: 0; border: none; } .card1 { width: 50%; padding: 40px 30px 10px 30px; } .card2 { width: 50%; background-image: linear-gradient(to right, rgb(31, 210, 241), rgb(248, 64, 8)); } .heading { margin-bottom: 60px !important; } ::placeholder { color: #000 !important; opacity: 1; } .form-control-label { font-size: 12px; margin-left: 15px; } .msg-info { padding-left: 15px; margin-bottom: 30px; } .btn-color { border-radius: 1px; color: #fff; background-image: linear-gradient(to right, #FFD54F, #D500F9); padding: 15px; cursor: pointer; border: none; margin-top: 40px; } .btn-color:hover { background-image: linear-gradient(to right, rgb(123, 10, 143), rgb(0, 255, 76)); } a { color: #000; } a:hover { color: #000; } .sm-text { font-size: 15px; } .form-group .form-control { border-radius: 1px; }

Key Points:

  • Responsive Design: Thanks to Bootstrap, the design will adapt to different screen sizes.

  • CSS Styling: Includes visual improvements like gradients for buttons and background, focusing on modern UI/UX design principles.

  • Enhanced Structure: The sections are cleanly separated with proper indentations for easy readability and maintenance.

Soeng Souy

Soeng Souy

Website that learns and reads, PHP, Framework Laravel, How to and download Admin template sample source code free.

Post a Comment

CAN FEEDBACK
close