Bootstrap snippet and html example. bs4 login page with background cover

Bootstrap 4.1.1 snippet "bs4 login page with background cover" with HTML, CSS, and JS. Copy, paste, and customize this responsive UI component for your project.
Tags: login,page,background

HTML code

Clean, semantic HTML that powers this Bootstrap 4.1.1 snippet. Copy and paste it into your page (with Bootstrap loaded) to reproduce the exact layout shown in the preview.


<div class="container-fluid px-3">
  <div class="row min-vh-100">
    <div class="col-md-5 col-lg-6 col-xl-4 px-lg-5 d-flex align-items-center">
      <div class="w-100 py-5">
        <div class="text-center"><img src="//ssl.gstatic.com/accounts/ui/logo_2x.png" alt="..." style="max-width: 6rem;" class="img-fluid mb-4">
          <h1 class="display-4 mb-3">Sign in</h1>
        </div>
        <form method="get" class="form-validate" novalidate="novalidate">
          <div class="form-group">
            <label>Email Address</label>
            <input name="loginUsername" type="email" autocomplete="off" required="" data-msg="Please enter your email" class="form-control">
          </div>
          <div class="form-group mb-4">
            <div class="row">
              <div class="col">
                <label>Password</label>
              </div>
              <div class="col-auto"><a href="#" class="form-text small text-muted">Forgot password?</a></div>
            </div>
            <input name="loginPassword" type="password" required="" data-msg="Please enter your password" class="form-control">
          </div>
          <!-- Submit-->
          <button class="btn btn-lg btn-block btn-primary mb-3">Sign in</button>
          <!-- Link-->
          <p class="text-center"><small class="text-muted text-center">Don't have an account yet? <a href="register-2.html">Register</a>.</small></p>
        </form>
      </div>
    </div>
    <div class="col-12 col-md-7 col-lg-6 col-xl-8 d-none d-lg-block">
      <!-- Image-->
      <div style="background-image: url(https://bootdey.com/img/Content/flores-amarillas-wallpaper.jpeg);" class="bg-cover h-100 mr-n3"></div>
    </div>
  </div>
</div>

CSS code

Scoped CSS that styles the component. Paste it after Bootstrap 4.1.1 to keep the design, spacing, and responsiveness consistent.


body{
    margin-top:20px;
}
.form-control {
    height: calc(2.25rem + 2px);
    border: 1px solid #dee2e6;
    border-radius: 0;
    padding: .375rem .75rem;
}
.container-fluid {
    padding: 0 30px;
}
small, .small {
    font-size: 80%;
    font-weight: 400;
}
.bg-cover {
    background-size: cover;
}

FAQ

How do I use this snippet?

Include Bootstrap 4.1.1, paste the HTML, add the CSS block, and include the JS (if any) to mirror the live preview.

Can I use it in commercial projects?

Yes. It’s free for personal and commercial work; check the snippets license for details.

Is it responsive?

Yes. It inherits the responsive grid and components from Bootstrap 4.1.1.

Bootstrap example and template. bs4 login page with background cover

About this bootstrap example/template

Optimized for copy‑paste: clean HTML, scoped CSS, and minimal JS so you can ship production‑ready UI faster and keep designs consistent.

Mobile‑first and responsive by default. Tested across modern browsers to reduce polish time on your project.

Already trusted in 1.0K+ views. Reuse this snippet to speed up landing pages, dashboards, or onboarding flows.

Bootstrap 4.1.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.1.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

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