Center Pills nav and Pills content Bootstrap - html

I'm currently working on a project that involves a login and register form. I decided to use bootstrap pills for this matter.
This is login and register html form
<link href="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/3.3.0/mdb.min.css" rel="stylesheet"/>
<link href="https://cdn.jsdelivr.net/npm/bootstrap#4.5.3/dist/css/bootstrap.min.css" rel="stylesheet"/>
<!-- Pills navs -->
<ul class="nav nav-pills nav-justified mb-3" id="ex1" role="tablist">
<li class="nav-item" role="presentation">
<a class="nav-link active" id="tab-login" data-mdb-toggle="pill" href="#pills-login" role="tab" aria-controls="pills-login" aria-selected="true">Login</a
>
</li>
<li class="nav-item" role="presentation">
<a
class="nav-link"
id="tab-register"
data-mdb-toggle="pill"
href="#pills-register"
role="tab"
aria-controls="pills-register"
aria-selected="false"
>Register</a
>
</li>
</ul>
<!-- Pills navs -->
<!-- Pills content -->
<div class="tab-content">
<div
class="tab-pane fade show active"
id="pills-login"
role="tabpanel"
aria-labelledby="tab-login"
>
<form action="/login" method="post">
<br>
<!-- Email/Username input -->
<div class="form-outline mb-4 login">
<input type="text" id="loginCred" name="loginCred" autofocus autocomplete="off" class="form-control" />
<label class="form-label" for="loginCred">Email or username</label>
</div>
<br>
<!-- Password input -->
<div class="form-outline mb-4 login">
<input type="password" id="loginPassword" name="loginPassword" class="form-control" />
<label class="form-label" for="loginPassword">Password</label>
</div>
<!-- 2 column grid layout -->
<div class="row mb-4">
<div class="col-md-12 d-flex justify-content-center">
<!-- Simple link -->
Forgot password?
</div>
</div>
<!-- Submit button -->
<button type="submit" id="login" disabled="disabled" class="btn btn-dark btn-block mb-4">Log in</button>
<!-- Register button -->
<div class="text-center">
<p>Not a member? <a id="reg" href="">Register</a></p>
</div>
</form>
</div>
<div class="tab-pane fade" id="pills-register" role="tabpanel" aria-labelledby="tab-register">
<form action="/register" method="post" onchange="onFormUpdate()">
<br>
<!-- Name input -->
<div class="form-outline mb-4 register">
<input type="text" id="registerName" name="registerName" autofocus autocomplete="off" class="form-control" />
<label class="form-label" for="registerName">Full Name</label>
</div>
<!-- Username input -->
<div class="form-outline mb-4 register">
<input type="text" id="registerUsername" name="registerUsername" autocomplete="off" class="form-control" />
<label class="form-label" for="registerUsername">Username</label>
</div>
<div class="row-sm-3 mb-2">
<small id="passwordHelp" class="text-danger"></small>
</div>
<!-- Email input -->
<div class="form-outline mb-4 register">
<input type="email" id="registerEmail" name="registerEmail" autocomplete="off" class="form-control" />
<label class="form-label" for="registerEmail">Email</label>
</div>
<!-- Password input -->
<div id="pass" class="form-outline mb-4 register">
<input type="password" id="registerPassword" name="registerPassword" class="form-control" />
<label class="form-label" for="registerPassword">Password</label>
</div>
<div class="row-sm-3 mb-2">
<small id="passwordHelp" class="text-danger"></small>
</div>
<!-- Confirm Password input -->
<div id="confirm-pass" class="form-outline mb-4 register">
<input type="password" id="registerConfirmPassword" name="registerConfirmPassword" class="form-control" />
<label class="form-label" for="registerConfirmPassword">Confirm Password</label>
</div>
<div class="row-sm-3 mb-2">
<small id="confirmPasswordHelp" class="text-danger"></small>
</div>
<!-- Checkbox -->
<div class="form-check d-flex justify-content-center mb-4">
<input class="form-check-input me-2" type="checkbox" value="" id="registerCheck" aria-describedby="registerCheckHelpText" />
<label class="form-check-label" for="registerCheck">
I have read and agree to the terms and conditions
</label>
</div>
<!-- Submit button -->
<button type="submit" id="register" disabled="disabled" class="btn btn-dark btn-block mb-3">Register</button>
<!-- Login button -->
<div class="text-center">
<p>Already a member? <a id="log" href="">Log in</a></p>
</div>
</form>
</div>
</div>
<!-- Pills content -->
As you can see, the form is stretched over the page. So I tried to minimize it using bootstrap w-50 as you can see below
<link href="https://cdn.jsdelivr.net/npm/bootstrap#4.5.3/dist/css/bootstrap.min.css" rel="stylesheet"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/3.3.0/mdb.min.css" rel="stylesheet"/>
<!-- Pills navs -->
<ul class="nav nav-pills nav-justified mb-3 w-50" id="ex1" role="tablist">
<li class="nav-item" role="presentation">
<a class="nav-link active" id="tab-login" data-mdb-toggle="pill" href="#pills-login" role="tab" aria-controls="pills-login" aria-selected="true">Login</a
>
</li>
<li class="nav-item" role="presentation">
<a
class="nav-link"
id="tab-register"
data-mdb-toggle="pill"
href="#pills-register"
role="tab"
aria-controls="pills-register"
aria-selected="false"
>Register</a
>
</li>
</ul>
<!-- Pills navs -->
<!-- Pills content -->
<div class="tab-content">
<div
class="tab-pane fade show active"
id="pills-login"
role="tabpanel"
aria-labelledby="tab-login"
>
<form action="/login" method="post">
<br>
<!-- Email/Username input -->
<div class="form-outline mb-4 w-50 login">
<input type="text" id="loginCred" name="loginCred" autofocus autocomplete="off" class="form-control" />
<label class="form-label" for="loginCred">Email or username</label>
</div>
<br>
<!-- Password input -->
<div class="form-outline mb-4 login">
<input type="password" id="loginPassword" name="loginPassword" class="form-control" />
<label class="form-label" for="loginPassword">Password</label>
</div>
<!-- 2 column grid layout -->
<div class="row mb-4">
<div class="col-md-12 d-flex justify-content-center">
<!-- Simple link -->
Forgot password?
</div>
</div>
<!-- Submit button -->
<button type="submit" id="login" disabled="disabled" class="btn btn-dark btn-block mb-4">Log in</button>
</div>
<!-- Pills content -->
Now another problem arises. The from is left aligned. I searched and came to a few answers but most of them were using flex and grids. I couldn't use it in my code. I didn't find anything about nav pills and nav content.
Any help to center the form is appreciated.
Edit: I tried using justify-content-center and it didn't work also.

You could use the .mx-auto class with your .w-50 class, it will horizontally center your form
<link href="https://cdn.jsdelivr.net/npm/bootstrap#4.5.3/dist/css/bootstrap.min.css" rel="stylesheet"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/mdb-ui-kit/3.3.0/mdb.min.css" rel="stylesheet"/>
<!-- Pills navs -->
<ul class="nav nav-pills nav-justified mb-3 w-50 mx-auto" id="ex1" role="tablist">
<li class="nav-item" role="presentation">
<a class="nav-link active" id="tab-login" data-mdb-toggle="pill" href="#pills-login" role="tab" aria-controls="pills-login" aria-selected="true">Login</a
>
</li>
<li class="nav-item" role="presentation">
<a
class="nav-link"
id="tab-register"
data-mdb-toggle="pill"
href="#pills-register"
role="tab"
aria-controls="pills-register"
aria-selected="false"
>Register</a
>
</li>
</ul>
<!-- Pills navs -->
<!-- Pills content -->
<div class="tab-content">
<div
class="tab-pane fade show active"
id="pills-login"
role="tabpanel"
aria-labelledby="tab-login"
>
<form action="/login" method="post">
<br>
<!-- Email/Username input -->
<div class="form-outline mb-4 w-50 login">
<input type="text" id="loginCred" name="loginCred" autofocus autocomplete="off" class="form-control" />
<label class="form-label" for="loginCred">Email or username</label>
</div>
<br>
<!-- Password input -->
<div class="form-outline mb-4 login">
<input type="password" id="loginPassword" name="loginPassword" class="form-control" />
<label class="form-label" for="loginPassword">Password</label>
</div>
<!-- 2 column grid layout -->
<div class="row mb-4">
<div class="col-md-12 d-flex justify-content-center">
<!-- Simple link -->
Forgot password?
</div>
</div>
<!-- Submit button -->
<button type="submit" id="login" disabled="disabled" class="btn btn-dark btn-block mb-4">Log in</button>
</div>
<!-- Pills content -->

Related

How to expand nav tabs to take equal widths in bootstrap? [duplicate]

This question already has answers here:
Full width tabs using Bootstrap (Support IE)
(9 answers)
Closed 2 years ago.
How can I make those two tabs of login and create account equally spaced and centered as given in the picture? I am only able to get them in the left corner and the tabs take up only as long as the text inside (as given in 2nd image). I want to make the tabs look like this:.
Sample Code :
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons#1.3.0/font/bootstrap-icons.css">
</head>
<body>
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item">
<a href="#login" id="tab1" class='nav-link active' aria-controls="login" aria-selected='true' role="tab" tabindex=1 data-toggle='tab'>LOGIN</a>
</li>
<li class="nav-item">
<a href="#create-account" id="tab2" class='nav-link' aria-controls="create-account" aria-selected='false' role="tab" tabindex=0 data-toggle='tab'>CREATE ACCOUNT</a>
</li>
</ul>
<div class="tab-content" id="myTabContent">
<div class="tab-pane active" id="login" role="tabpanel" aria-labelledby="tab1" aria-hidden='false'>
<!-- Addition of Form 1 -->
<form class="d-flex flex-column">
<div class="form-group">
<label for="exampleInputEmail1">Email address <span class='required'>*</span></label>
<input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Enter email">
</div>
<div class="form-group">
<label for="exampleInputPassword1">Password <span class='required'>*</span></label>
<div class="input-group d-flex flex-row">
<input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
<div class="input-group-append">
<div class="input-group-text">
<i href='#' class='bi bi-eye-fill ml-2'></i>
</div>
</div>
</div>
</div>
<button type="submit" class="btn btn-hover btn-orange rounded-0">SIGN IN</button><br>
<button type="submit" class="btn btn-hover btn-default2 rounded-0">FORGOT YOUR PASSWORD?</button>
</form>
</div>
</body>
</html>
Per the docs, use the nav-fill class.
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons#1.3.0/font/bootstrap-icons.css">
<ul class="nav nav-tabs nav-fill" id="myTab" role="tablist">
<li class="nav-item">
<a href="#login" id="tab1" class='nav-link active' aria-controls="login" aria-selected='true' role="tab" tabindex=1 data-toggle='tab'>LOGIN</a>
</li>
<li class="nav-item">
<a href="#create-account" id="tab2" class='nav-link' aria-controls="create-account" aria-selected='false' role="tab" tabindex=0 data-toggle='tab'>CREATE ACCOUNT</a>
</li>
</ul>
<div class="tab-content" id="myTabContent">
<div class="tab-pane active" id="login" role="tabpanel" aria-labelledby="tab1" aria-hidden='false'>
<!-- Addition of Form 1 -->
<form class="d-flex flex-column">
<div class="form-group">
<label for="exampleInputEmail1">Email address <span class='required'>*</span></label>
<input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Enter email">
</div>
<div class="form-group">
<label for="exampleInputPassword1">Password <span class='required'>*</span></label>
<div class="input-group d-flex flex-row">
<input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
<div class="input-group-append">
<div class="input-group-text">
<i href='#' class='bi bi-eye-fill ml-2'></i>
</div>
</div>
</div>
</div>
<button type="submit" class="btn btn-hover btn-orange rounded-0">SIGN IN</button><br>
<button type="submit" class="btn btn-hover btn-default2 rounded-0">FORGOT YOUR PASSWORD?</button>
</form>
</div>

CSS - Moving items around in Navbar

See screenshots for what I am trying to achieve.
https://imgur.com/jaOmFnz
https://imgur.com/aRxile9
The menu list items (My application, Register, Login) I want to move to the far right of the screen. I have tried messing with the margins, float:right, however still cannot get this to work.
The container div spans the full width. Would I need to amend this div?
I've created a codeped to illustrate this
https://codepen.io/jquerypain121/pen/OJNaWpa
<html><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Log in - PhotoUploaderForm</title>
</head>
<body>
<header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-dark bg-white border-bottom box-shadow mb-3">
<div class="container">
<img src="https://lh3.googleusercontent.com/proxy/HQAE10KQ0NmS9htB5BKSoN24jWvyaizAKwhGy8hNVVsCbFUubvDdLSsYB8xWbN3JUDzDuAzw0OxKO5QZyL_XPqitq1wcSYaMVJ35_oC48c4FKZYykJUoucS-LJT1" width="200" title="title" alt="additional title">
<a class="navbar-brand" href="/">My Application</a>
<div class="navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse">
<ul class=" moveright nav navbar-nav">
<a class="navbar-brand" href="/">My Application</a>
<li class="nav-item">
<a class="nav-link text-dark" id="register" href="/Identity/Account/Register">Register</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" id="login" href="/Identity/Account/Login">Login</a>
</li>
</ul>
<ul class="navbar-nav flex-grow-1">
</ul>
</div>
</div>
</nav>
</header>
<div class="container-fluid">
<main role="main" class="pb-3">
<h1>Log in</h1>
<div class="row">
<div class="col-md-4">
<section>
<form id="account" method="post" action="/Identity/Account/Login" novalidate="novalidate">
<hr>
<div class="text-danger validation-summary-valid" data-valmsg-summary="true"><ul><li style="display:none"></li>
</ul></div>
<div class="form-group">
<label for="Input_Email">Email</label>
<input class="form-control" type="email" data-val="true" data-val-email="The Email field is not a valid e-mail address." data-val-required="The Email field is required." id="Input_Email" name="Input.Email" value="">
<span class="text-danger field-validation-valid" data-valmsg-for="Input.Email" data-valmsg-replace="true"></span>
</div>
<div class="form-group">
<label for="Input_Password">Password</label>
<input class="form-control" type="password" data-val="true" data-val-required="The Password field is required." id="Input_Password" name="Input.Password">
<span class="text-danger field-validation-valid" data-valmsg-for="Input.Password" data-valmsg-replace="true"></span>
</div>
<div class="form-group">
<div class="checkbox">
<label for="Input_RememberMe">
<input type="checkbox" data-val="true" data-val-required="The Remember me? field is required." id="Input_RememberMe" name="Input.RememberMe" value="true">
Remember me?
</label>
</div>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary" formaction="/Identity/Account/Login?returnUrl=%2F">Log in</button>
<input type="hidden" id="ReturnUrl" name="ReturnUrl" value="/">
</div>
<div class="form-group">
<p>
Register as a new user
</p>
</div>
<input name="__RequestVerificationToken" type="hidden" value="CfDJ8PEcG7qoomVJk-wiZaqy0p6b5tfvXZTuVH-9YakoOKQQf8mWfBn4MYD7BCb3YKL_NmEz_Ru57zD8PV8Tq_6ea5WApccwrpwYrOkBdu7Qu9Z6NMycGCHqDTI35Ci1mPMVQSqyQ47sNdvfhZhfkMSx_DQ"><input name="Input.RememberMe" type="hidden" value="false"></form>
</section>
</div>
<div class="col-md-6 col-md-offset-2">
</div>
</div>
</main>
</div>
<footer class="border-top footer text-muted">
<div class="container">
<p style="float:left;color: white;">© 2020 - Leicestershire Health Informatics Service -</p>
<a style="float:right; margin-right: 10px;" href="/Home/Privacy">Privacy</a>
<a style="float:right;margin-right: 10px;" href="/Home/Information">Info</a>
<a style="float:right;margin-right: 10px;" href="/Home/TermsAndConditions">T&C</a>
</div>
</footer>
</body></html>
Any help would be appreciated, thanks
you don't need to customize the code. Bootstrap has it's own design which you want to achieve. For your reference https://getbootstrap.com/docs/4.5/components/navbar/
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet"/>
<nav class="navbar navbar-light bg-light">
<a class="navbar-brand">
<img src="https://getbootstrap.com/docs/4.5/assets/brand/bootstrap-solid.svg" width="30" height="30" class="d-inline-block align-top">
My Application
</a>
<div class="form-inline">
<a class="nav-link text-dark" href="">My Application</a>
<a class="nav-link text-dark" id="register" href="/Identity/Account/Register">Register</a>
<a class="nav-link text-dark" id="login" href="/Identity/Account/Login">Login</a>
</div>
</nav>
Instead of writing moveright in your ul class list, write ml-auto. This should move the list to the right.
Make the width of the nav 100%
and then make the ul float: right;
Hope it will work for you

Bootstrap min fixed width inside flex

I trying to make a search bar with bootstrap smth similar to holidaypiratescom search field.
I need to have min width on first and last button, while letting the 3 form fields to flex. If i set the width directly with css(min-width) the button element is sticks outside of the card when i shrink the screen. Have no idea how to do it, any suggestions?
<div class="card">
<div class="search-box d-md-inline-flex">
<!-- col1 -->
<div class="card border-0">
<input class="btn btn-primary" type="text" name="" value="All categories">
</div>
<!-- col2 -->
<div class="card border-0">
<input class="form-control mr-2" type="text" name="departure" placeholder="Departure">
</div>
<!-- col3 -->
<div class="card border-0">
<input class="form-control mr-2" type="text" name="destination" placeholder="Destination">
</div>
<!-- col4 -->
<div class="card border-0">
<input class="form-control mr-2" type="text" name="type" placeholder="Travel Period">
</div>
<!-- Submit -->
<div class="card border-0">
<input class="btn btn-primary" type="submit" name="" value="go">
</div>
</div><!--/search-box -->
</div> <!-- /card -->
<div class="card container">
<div class="container">
<div class="search-box d-md-inline-flex">
<!-- col1 -->
<div class="card border-0 p-3">
<input class="btn btn-primary" type="text" name="" value="All categories">
</div>
<!-- col2 -->
<div class="card border-0 p-3">
<input class="form-control mr-2" type="text" name="departure" placeholder="Departure">
</div>
<!-- col3 -->
<div class="card border-0 p-3">
<input class="form-control mr-2" type="text" name="destination" placeholder="Destination">
</div>
<!-- col4 -->
<div class="card border-0 p-3">
<input class="form-control mr-2" type="text" name="type" placeholder="Travel Period">
</div>
<!-- Submit -->
<div class="card border-0 p-3">
<input class="btn btn-primary" type="submit" name="" value="go">
</div>
</div><!--/search-box -->
</div>
</div>
Use the container class to wrap the content. For responsive use lg, md, sm for the classes.

Bootstrap4 move login form towards to the center

I have the following login page:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title> Log in </title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/css/bootstrap.min.css" integrity="sha384-Smlep5jCw/wG7hdkwQ/Z5nLIefveQRIY9nfy6xoR1uRYBtpZgI6339F5dgvm/e9B" crossorigin="anonymous">
</head>
<body>
<header>
<nav class="navbar navbar-dark bg-primary">
<a class="navbar-brand" href="/">
<img src="https://loremimage.com/default/32/32/1" />
Διαχείρηση Μελών ΕΛΛΑΚ Κύπρου
</a>
</nav>
</header>
<div class="container-fluid d-flex align-items-center justify-content-center">
<div class="row bg-light border border-primary">
<div class="col mt-5 col-xs-12 col-md-12 col-lg-12">
<h1 style="text-align:center">Log in</h1>
<form action="/login_check" method="post">
<div class="form-group">
<input type="text" class="form-control" id="username" name="_username" value="" placeholder="Username" required="required" />
<span class="glyphicon glyphicon-user form-control-feedback"></span>
</div>
<div class="form-group">
<input type="password" class="form-control" id="password" name="_password" placeholder="Password" required="required" />
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
</div>
<div class="form-group">
<div class="form-check">
<input type="checkbox" id="remember_me" name="_remember_me" class="form-check-input" />
<label class="form-check-label" for="remember_me" >Remember me</label>
</div>
</div>
<div class="form-row">
<div class="col">
<input type="submit" class="btn btn-primary btn-block" id="_submit" name="_submit" value="Log in" />
</div>
<div class="col">
<a class="btn btn-warning btn-block" href="/resetting/request">I forgot my password</a>
</div>
</div>
</form>
</div>
<div class="col col-xs-12 col-md-12 col-lg-12 mt-1 mb-5">
<a class="btn btn-primary btn-block" href="/register/">I do not have an account</a>
</div>
</div>
</div>
</body>
</html>
And my problem is that the login form is not too center as I want to as this image shows.
What I want to do is to display like that:
So do you know how to move the whole login form towards the center I tried the bootstrap's d-flex align-items-center justify-content-center class combination and somehow it does center but the flexbox is as height as my login form.
So my guess is on how I can make the flexbox take over the whole remaining height. DO you know how to do that?
You should give height to your container-fluid div in view-port
height: calc(100vh - 60px);
60px is your header height (View in full-screen mode of snippet)
.custom {
height: calc(100vh - 60px);
}
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title> Log in </title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/css/bootstrap.min.css" integrity="sha384-Smlep5jCw/wG7hdkwQ/Z5nLIefveQRIY9nfy6xoR1uRYBtpZgI6339F5dgvm/e9B" crossorigin="anonymous">
</head>
<body>
<header>
<nav class="navbar navbar-dark bg-primary">
<a class="navbar-brand" href="/">
<img src="https://loremimage.com/default/32/32/1" />
Διαχείρηση Μελών ΕΛΛΑΚ Κύπρου
</a>
</nav>
</header>
<div class="custom container-fluid d-flex align-items-center justify-content-center">
<div class="row bg-light border border-primary">
<div class="col mt-5 col-xs-12 col-md-12 col-lg-12">
<h1 style="text-align:center">Log in</h1>
<form action="/login_check" method="post">
<div class="form-group">
<input type="text" class="form-control" id="username" name="_username" value="" placeholder="Username" required="required" />
<span class="glyphicon glyphicon-user form-control-feedback"></span>
</div>
<div class="form-group">
<input type="password" class="form-control" id="password" name="_password" placeholder="Password" required="required" />
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
</div>
<div class="form-group">
<div class="form-check">
<input type="checkbox" id="remember_me" name="_remember_me" class="form-check-input" />
<label class="form-check-label" for="remember_me" >Remember me</label>
</div>
</div>
<div class="form-row">
<div class="col">
<input type="submit" class="btn btn-primary btn-block" id="_submit" name="_submit" value="Log in" />
</div>
<div class="col">
<a class="btn btn-warning btn-block" href="/resetting/request">I forgot my password</a>
</div>
</div>
</form>
</div>
<div class="col col-xs-12 col-md-12 col-lg-12 mt-1 mb-5">
<a class="btn btn-primary btn-block" href="/register/">I do not have an account</a>
</div>
</div>
</div>
</body>
</html>

form-inline causing overlap of individual form-group components

as I learn more about bootstrap, I am making good progress but I am once again faced with a basic challenge. This is about inline-forms.
Please see attached screenshot. As you can see, I have two problems. The first and easily identifiable is that in the 'experience' section - this is an inline form nested within a form-group and the problem is overlapping fields. Ideally they should all be next to each other with a 10px buffer between them. The code for this section is below
<div class="form-group row-top-buffer">
<label for="experience" class="col-md-3 control-label">Experience</label>
<div class="col-md-9 form-inline" role="form">
<div class="form-group col-md-3">
<label class="sr-only" for="jobMinExperience">Min Experience</label>
<input type="text" class="form-control" id="jobMinExperience" placeholder="0" />
</div>
<div class="form-group col-md-3">
<label class="sr-only" for="jobMaxExperience">Max Experience</label>
<input type="text" class="form-control" id="jobMaxExperience" placeholder="0" />
</div>
<div class="form-group col-md-3">
<label class="sr-only" for="jobExperienceDropDown">Experience</label>
<div class="dropdown">
<button class="btn btn-default dropdown-toggle" type="button" id="jobExperienceDropDown" data-toggle="dropdown">
Dropdown
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu" aria-labelledby="jobExperienceDropDown">
<li role="presentation">
<a role="menuitem" tabindex="-1" href="#">years</a>
</li>
<li role="presentation">
<a role="menuitem" tabindex="-1" href="#">months</a>
</li>
</ul>
</div>
</div>
</div>
</div>
The second problem which is not so apparent, is the one in the 'Location' row. I have two rows of components. the first is a simple full-width text input. The second row however is an inline form comprising of multiple components. Here I would like the final text box, for zip code, to stretch until the end of the 1st row - but it abruptly stops short. Code for this secion is provided below
<div class="form-group row-top-buffer">
<label for="jobLocation" class="col-md-3 control-label">Location</label>
<div class="col-md-9">
<input type="text" class="form-control" id="jobStreet" name="jobStreet" placeholder="Street" />
<div class="form-inline" role="form" style="padding-top: 9px;">
<div class="form-group col-md-5">
<label class="sr-only" for="jobCity">City</label>
<input type="text" class="form-control" id="jobCity" name="jobCity" placeholder="City" />
</div>
<div class="form-group col-md-2 margin-0">
<label class="sr-only" for="jobState">State</label>
<?
include_once 'stateDropDown.php';
?>
</div>
<div class="form-group col-md-3 margin-0">
<label class="sr-only" for="jobZip">City</label>
<input type="text" class="form-control" id="jobZip" name="jobZip" placeholder="00000" />
</div>
</div>
</div>
</div>
Form layout has a lot to do with the class on the form itself, such as form-horizontal, which is the type of form your screen shot reflects. However, your html was mixing inline form classes and combining col classes on the form-group, which is like adding a column class to a row --it's not done. Anyway, this is not your exact form, but it is commented enough to get what you want once you learn it. I put in your dropdowns just for this, but unless you're using some addon that makes selects into dropdowns (there is one) you would use a select menu in a form.
DEMO: http://jsbin.com/fecib/2/edit
<form class="form-horizontal my-form" role="form">
<div class="form-group">
<label class="col-sm-3 control-label">Location</label>
<div class="col-sm-9">
<input type="text" class="form-control" placeholder="location">
</div><!-- /col-sm-9 -->
</div><!-- /form-group -->
<div class="form-group">
<div class="col-sm-offset-3 col-sm-9">
<div class="form-group"> <!-- nested form-group acting like row -->
<div class="col-sm-6">
<input type="text" class="form-control" placeholder="City">
</div><!-- /col-sm-6 -->
<div class="col-sm-4">
<input type="text" class="form-control" placeholder="State">
</div><!-- /col-sm-4 -->
<div class="col-sm-2">
<input type="text" class="form-control" placeholder="Zip">
</div><!-- /col-sm-2 -->
</div> <!-- /nested form-group acting like row -->
</div><!-- /col-sm-offset-3 col-sm-9 -->
</div><!-- /form-group -->
<div class="form-group">
<label for="location" class="col-sm-3 control-label">Priority</label>
<div class="col-sm-9">
<div class="dropdown">
<button class="btn btn-default dropdown-toggle" type="button" id="jobExperienceDropDown" data-toggle="dropdown"> Dropdown <span class="caret"></span> </button>
<ul class="dropdown-menu" role="menu" aria-labelledby="jobExperienceDropDown">
<li role="presentation"> <a role="menuitem" tabindex="-1" href="#">years</a> </li>
<li role="presentation"> <a role="menuitem" tabindex="-1" href="#">months</a> </li>
</ul>
</div><!-- /dropdown -->
</div><!-- /col-sm-9-->
</div><!-- /form-group -->
<div class="form-group">
<label class="col-sm-3 control-label">Experience</label>
<div class="col-sm-9">
<div class="form-group"><!-- nested form-group acting like row -->
<div class="col-sm-4">
<input type="text" class="form-control" placeholder="0">
</div><!-- /.col-sm-4 -->
<div class="col-sm-4">
<input type="text" class="form-control" placeholder="0">
</div><!-- /.col-sm-4 -->
<div class="col-sm-4">
<div class="dropdown">
<button class="btn btn-default dropdown-toggle" type="button" id="jobExperienceDropDown" data-toggle="dropdown"> Dropdown <span class="caret"></span> </button>
<ul class="dropdown-menu" role="menu" aria-labelledby="jobExperienceDropDown">
<li role="presentation"> <a role="menuitem" tabindex="-1" href="#">years</a> </li>
<li role="presentation"> <a role="menuitem" tabindex="-1" href="#">months</a> </li>
</ul>
</div><!-- /dropdown -->
</div><!-- /.col-sm-4 -->
</div><!-- /nested form-group acting like row -->
</div><!-- /.col-sm-9 -->
</div><!-- /.form-group -->
<div class="form-group">
<div class="col-sm-offset-3 col-sm-9">
<button type="submit" class="btn btn-default">Sign in</button>
</div>
</div>
</form>
CSS:
/* ----------- adjusted nested columns grid ----------- */
.my-form .form-group [class*="col-"] .form-group [class*="col-"] {
padding-left: .5%;
padding-right: .5%;
}
.my-form .form-group [class*="col-"] .form-group {
margin-left: -.5%;
margin-right: -.5%;
}
.my-form .form-group [class*="col-"] .form-group [class*="col-"]:not(:last-child) {
margin-bottom: 10px
}
#media (min-width:768px) {
.my-form .form-group [class*="col-"] .form-group [class*="col-"]:not(:last-child) {
margin-bottom: 0
}
}
.my-form .form-group [class*="col-"] .form-group {
margin-bottom: 0
}