Bootstrap snippet and html example. Login form

This html snippet was created to help web designers, web developers, front-end and back-end developer save time. Use it for free in your project and build your app faster, You can also download the HTML, CSS, and JS code.

HTML code

This is the html code used to create this bootstrap snippet, You can copy and paste the following html code inside a page with bootstrap 4.3.1 included, to get the result that you can see in the preview selection

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" crossorigin="anonymous">

<div class="container">
  <div class="row">
    <div class="col-md-4"></div>
    <div class="col-md-5">
      <div class="card cardbox">
        <div class="card-header">Login</div>
        <div class="card-body">

          <!-- socail media group -->
          <div class="social-buttons">
            <a href="#" class="btn btn-md btn-block btn-fb"><i class="fa fa-facebook"></i> Facebook</a>
            <a href="#" class="btn btn-md btn-block btn-tw"><i class="fa fa-twitter"></i> Twitter</a>
          </div>

          <div class="login-or">
            <hr class="hr-or">
            <span class="span-or">or</span>
          </div>

          <div class="form-group">

            <form id="login-nav" method="post" role="form" class="form" accept-charset="UTF-8">

              <div class="form-group">
                <label class="sr-only">Username</label>
                <input type="text" id="reg_username" name="user_name" class="form-control"
                       value="" placeholder="Username" required>
              </div>

              <!-- password group -->
              <div class="form-group">

                <!-- password label -->
                <label class="sr-only">Password</label>
                <!-- password input -->
                <div class="input-group">
                  <input type="password" id="reg_userpassword" name="user_password" class="form-control" data-placement="bottom" data-toggle="popover" data-container="body"
                         data-html="true" value="" placeholder="Password" required>

                  <div class="input-group-append">
                    <button class="btn btn-outline-secondary" type="button" id="button-append1" onclick="togglePassword()">
                      <i class="fa fa-eye" aria-hidden="true"></i>
                    </button>
                  </div>
                </div>
                <!-- password remember & results -->
                <div class="help-block text-right">
                  <small><a href="#">Forgot Password</a></small>
                </div>       
    

              </div>


              <!-- Submit -->
              <div class="form-group">
                <button id="reg_submit" name="submit"  value="1" class="btn btn-block btn-primary">Login</button>
              </div>

              <!-- Remember -->
              <div class="form-check">
                <input type="checkbox" id="reg_remember" name="user_remember" class="form-check-input" value="1">
                <label class="form-check-label">Remember me</label>
              </div>

            </form>
          </div>

          <div class="login-or"><hr class="hr-or"></div>
          <!-- Links -->
          <div class="bottom text-center">
            Aren't you user? <a href="#"><b>Register</b></a>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

CSS code

This is the css code used to create this bootstrap snippet, You can copy and paste the following css code inside a page with bootstrap 4.3.1 included, to get the result that you can see in the preview selection

.row{
  margin-top: 50px;
  margin-bottom: 50px;
}

.masthead-text{
  height: 300px;
}

.form-control{
  height: 45px;
}

.login-or {
    position: relative;
    font-size: 18px;
    color: #aaa;
    margin-top: 20px;
    margin-bottom: 20px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .span-or {
    display: block;
    position: absolute;
    left: 50%;
    top: -2px;
    margin-left: -25px;
    background-color: #fff;
    width: 50px;
    text-align: center;
  }
  .hr-or {
    background-color: #cdcdcd;
    height: 1px;
    margin-top: 0px !important;
    margin-bottom: 0px !important;
  }

#login-dp{
    min-width: 250px;
    padding: 14px 14px 0;
    overflow:hidden;
    background-color:rgba(255,255,255,.8);
}
#login-dp .help-block{
    font-size:12px    
}

#login-dp .social-buttons{
    margin:12px 0    
}
#login-dp .social-buttons a{
    width: 49%;
}
#login-dp .form-group {
    margin-bottom: 10px;
}
.btn-fb{
    color: #fff;
    background-color:#3b5998;
}
.btn-fb:hover{
    color: #fff;
    background-color:#496ebc 
}
.btn-tw{
    color: #fff;
    background-color:#55acee;
}
.btn-tw:hover{
    color: #fff;
    background-color:#59b5fa;
}
@media(max-width:768px){
    #login-dp{
        background-color: inherit;
        color: #fff;
    }
    #login-dp .bottom{
        background-color: inherit;
        border-top:0 none;
    }
}




Javascript/Jquery code

This is the javascript code used to create this bootstrap snippet, You can copy and paste the following javascript code inside a page with bootstrap 4.3.1 included, to get the result that you can see in the preview selection

// Şifre gizle göster
function togglePassword() {

  var element = document.getElementById('reg_userpassword');
  element.type = (element.type == 'password' ? 'text' : 'password');

};
 

Similar snippets

Bootstrap example and template. User profile resume

User profile resume

Bootstrap example and template. colored timeline

colored timeline

Bootstrap example and template. Social Network timeline feed

Social Network timeline feed

Bootstrap example and template. social blog post widget with commets

social blog post widget with commets

Bootstrap example and template. bs5 dark footer

bs5 dark footer

Bootstrap example and template. bs4 simple chat app

bs4 simple chat app

Bootstrap example and template. bs4 past orders profile

bs4 past orders profile

Bootstrap example and template. new customer list

new customer list

Bootstrap example and template. Login form

About this bootstrap example/template

We hope you will enjoy this awesome snippet and stay tuned for the latest updates, bootdey snippets are already used in thousands of blogs, websites and projects. We believe it will save your precious time and gives trendy look to your next web project.

We always try to offer the best beautiful and responsive source of Bootstrap code examples and components.

This code example currectly have 1.1K views, Using this bootstrap snippet you have the following benefits:

Bootstrap 4.3.1

<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css'>

<script src='https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js'></script>

This code example is based on bootstrap 4.3.1 and the grid system of this framework

Responsive

Based on bootstrap framework makes all the layouts perfectly responsive for all devices

Crossbrowser compatibility

Tested on all major browsers, it works smoothly on all of them

Jquery plugins

Great built-in plugins with jquery framework, you can easy to change all declarations

semantic html 5

Built on html / css3 the code quality is really amazing

Simple Integration

This code example can be simply integrated on existing sites and new ones too, all you need to do is copy the code and start working