Bootstrap Modal Form: Rows are not under the first row - html

I have been trying to get the last 2 rows to be under the first row but to no avail, I have tried to place the 2 rows under the same container of "Name" Row, but the last 2 rows textboxes turned small instead of going placing right under the first row of "Name" Row. Right now, both of the rows are stuck under the img container.
#output_image {
border-style: solid;
float: left;
position: relative;
}
.inputfile {
width: 0.1px;
height: 0.1px;
opacity: 0;
overflow: hidden;
position: relative;
z-index: -1;
}
.label {
opacity: 0;
}
.inputfile+label {
position: relative;
font-size: 2.5em;
display: inline-block;
color: black;
text-align: center;
padding: 2px 2px;
text-decoration: none;
float: left;
}
.inputfile:focus+label,
.inputfile+label:hover {}
.inputfile+label {
cursor: pointer;
}
.iconplus {
position: relative;
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.min.css">
<link rel="stylesheet" href="//cdn.datatables.net/1.10.21/css/jquery.dataTables.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<button type="button" class="btn btn-primary" data-toggle="modal" data-target=".bd-example-modal-lg">
Instagram Like
</button>
<!-- Modal -->
<div class="modal fade bd-example-modal-lg" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl modal-dialog-right" role="document">
<div class="modal-content">
<div class="modal-header ">
<h2 style="font-family: Lato; font-size:29pt; font-weight:bold;" class="modal-title " id="exampleModalLongTitle">Instagram</h2>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form class="form-horizontal " id="step2">
<div class="form-row" id="comNameAndTypeContainer">
<img id="output_image" height=270px width=270px>
<input class="inputfile" type="file" id="getFile" accept="image/*" onchange="preview_image(event)">
<label for="getFile" <i class="fa fa-plus-circle iconplus" style="position:relative; top:23.1rem; right:3.45rem;"></i> </label>
<!-- Staff name -->
<div class="form-group col-md-5 align-items-center justify-content-center" id="comNameDiv">
<label for="comName" class="fieldHeader"> Name</label>
<input type="text" class="form-control" id="comName" name="comName" placeholder="Enter Name..." required>
</div>
</div>
<!-- Staff identifier -->
<div class="form-row" id="comNameAndTypeContainerr">
<div class="form-group col-md-5" id="comIdentifierDiv">
<label for="comIdentifier" class="fieldHeader">Email/ID</label>
<input type="text" class="form-control" id="comIdentifier" name="comIdentifier" placeholder="Enter Email/ID..." required>
</div>
</div>
<div class="form-row" id="comNameAndTypeContainerrr">
<div class="form-group col-md-2" id="comIdentifierDiv">
<label for="comIdentifier" class="fieldHeader">ID date</label>
<input type="text" class="form-control" id="comIdentifier" name="comIdentifier" placeholder="Enter start ID..." required>
</div>
<div class="form-group col-md-2" id="comIdentifierDiv">
<input type="text" class="form-control" id="comIdentifier" name="comIdentifier" placeholder="Enter End ID..." required>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary">Create</button>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js#1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>
<script src="//cdn.datatables.net/1.10.21/js/jquery.dataTables.min.js"></script>

I have just swap some of the order of your html and does not included any of my own code in your style css or in your html file.
#output_image {
border-style: solid;
float: left;
position: relative;
}
.inputfile {
width: 0.1px;
height: 0.1px;
opacity: 0;
overflow: hidden;
position: relative;
z-index: -1;
}
.label {
opacity: 0;
}
.inputfile+label {
position: relative;
font-size: 2.5em;
display: inline-block;
color: black;
text-align: center;
padding: 2px 2px;
text-decoration: none;
float: left;
}
.inputfile:focus+label,
.inputfile+label:hover {}
.inputfile+label {
cursor: pointer;
}
.iconplus {
position: relative;
}
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous">
</script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous">
</script>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target=".bd-example-modal-lg">
Instagram Like
</button>
<!-- Modal -->
<div class="modal fade bd-example-modal-lg" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl modal-dialog-right" role="document">
<div class="modal-content">
<div class="modal-header ">
<h2 style="font-family: Lato; font-size:29pt; font-weight:bold;" class="modal-title " id="exampleModalLongTitle">Instagram</h2>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form class="form-horizontal " id="step2">
<div class="form-row" id="comNameAndTypeContainer">
<img id="output_image" height=270px width=270px>
<input class="inputfile" type="file" id="getFile" accept="image/*" onchange="preview_image(event)">
<label for="getFile" <i class="fa fa-plus-circle iconplus" style="position:relative; top:23.1rem; right:3.45rem;"></i> </label>
<!-- Staff name -->
<div class="form-group col-md-5 align-items-center justify-content-center" id="comNameDiv">
<label for="comName" class="fieldHeader"> Name</label>
<input type="text" class="form-control" id="comName" name="comName" placeholder="Enter Name..." required>
<!-- Staff identifier -->
<div class="form-row" id="comNameAndTypeContainerr">
<div class="form-group col" id="comIdentifierDiv">
<label for="comIdentifier" class="fieldHeader">Email/ID</label>
<input type="text" class="form-control" id="comIdentifier" name="comIdentifier" placeholder="Enter Email/ID..." required>
</div>
<div class="form-row" style="padding-left: 5px;" id="comNameAndTypeContainerrr">
<div class="form-group col" id="comIdentifierDiv">
<label for="comIdentifier" class="fieldHeader pl-0">ID date</label>
<input type="text" class="form-control" id="comIdentifier" name="comIdentifier" placeholder="Enter start ID..." required>
</div>
<div class="form-group col" id="comIdentifierDiv">
<label for="comIdentifier" class="text-white fieldHeader">ID date</label>
<input type="text" class="form-control" id="comIdentifier" name="comIdentifier" placeholder="Enter End ID..." required>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary">Create</button>
</div>
</div>
</div>
</div>

Related

How to delete the space between these two elements with bootstrap grid

Here is the code of a login form on which I'm working on:
<main>
<div class="container-fluid">
<div class="row d-flex justify-content-center align-items-center">
<div class="col-6">
<h3 class="display-3">Sign In<h3>
<form class="justify-content-md-center">
<div class="col-md-auto">
<input type="text" required placeholder=" Username"
style="font-family:Arial, FontAwesome">
</div>
<div class="col-md-auto">
<input class="margin-25px" type="password" requires
placeholder=" Password"
style="font-family:Arial, FontAwesome">
</div>
<div class="container-fluid row justify-content-md-center">
<div class="col-sm">
<img class="icon" src="images/check-box.svg"
alt="check-box">
</div>
<div class="col-auto">
<p>Forgot your password?</p>
</div>
</div>
<button class="login__button btn btn-primary" type="submit">
LOGIN
</button>
</form>
</div>
</div>
</div>
</main>
I tried to do the layout with bootstrap grid, but can't find how to nest these two object, which are image with the class icon and the paragraph.
how it looks in chrome
You may use the following lines:
#login .container #login-row #login-column #login-box {
margin-top: 120px;
max-width: 600px;
height: 320px;
border: 1px solid #9C9C9C;
background-color: #EAEAEA;
}
#login .container #login-row #login-column #login-box #login-form {
padding: 20px;
}
#login .container #login-row #login-column #login-box #login-form #register-link {
margin-top: -85px;
}
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<body>
<div id="login">
<h3 class="text-center text-white pt-5">Login form</h3>
<div class="container">
<div id="login-row" class="row justify-content-center align-items-center">
<div id="login-column" class="col-md-6">
<div id="login-box" class="col-md-12">
<form id="login-form" class="form" action="" method="post">
<h3 class="text-center text-info">Login</h3>
<div class="form-group">
<label for="username" class="text-info">Username:</label><br>
<input type="text" name="username" id="username" class="form-control">
</div>
<div class="form-group">
<label for="password" class="text-info">Password:</label><br>
<input type="text" name="password" id="password" class="form-control">
</div>
<div class="form-group">
<label for="remember-me" class="text-info"><span>Remember me</span> <span><input id="remember-me" name="remember-me" type="checkbox"></span></label><br>
<input type="submit" name="submit" class="btn btn-info btn-md" value="Login">
</div>
<div id="register-link" class="text-right">
Forgot your password ?
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</body>
I already found it in the codepen and I can't remember the author's name to mention here.

bootstrap modal form label/textbox size empty spaces issue

At the start, the first label line has empty spaces in front of it, causing it to be pushed forward. Hence, I adjusted it using style in the HTML page, why and how do I resolve this issue?
I am unable to change the textbox size of the form as well. I would like to change the textbox size in the Food div container, both of the text boxes to be aligned in one straight line and the word "To" in between the boxes, without affecting the whole form alignment.
#output_image{
border-style: solid;
float:left;
}
.inputfile {
width: 0.1px;
height: 0.1px;
opacity: 0;
overflow: hidden;
position: relative;
z-index: -1;
}
.label{
opacity: 0;
}
.inputfile + label {
position: relative;
font-size: 2.5em;
display: inline-block;
color: black;
text-align: center;
padding: 2px 2px;
text-decoration: none;
float:left;
}
.inputfile:focus + label,
.inputfile + label:hover {
}
.inputfile + label {
cursor: pointer;
}
.iconplus{
position: relative;
}
<button type="button" class="btn btn-primary" data-toggle="modal" data-target=".bd-example-modal-lg">
Instagram Like
</button>
<!-- Modal -->
<div class="modal fade bd-example-modal-lg" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl modal-dialog-right" role="document">
<div class="modal-content">
<div class="modal-header ">
<h2 style="font-family: Lato; font-size:29pt; font-weight:bold;" class="modal-title " id="exampleModalLongTitle">Instagram</h2>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body form-horizontal">
<form class="form-horizontal" id="step2">
<img id="output_image" height=270px width=270px>
<input class="inputfile" type="file" id="getFile" accept="image/*" onchange="preview_image(event)">
<label for="getFile" <i class="fa fa-plus-circle iconplus" style = "position:relative; top:23.1rem; right:3.45rem;"></i> </label>
<div class="form-group row align-items-center justify-content-center">
<label style="font-family:Lato; font-size:20pt; font-weight:normal; margin-right:6.8rem;" for="name" class="col-sm-4 control-label col text-left">Name:</label>
<div class="col-sm-5 ">
<input id="name" style= "margin-right:10rem;" class="form-control input-lg row align-items-left justify-content-left" type="text" placeholder="Enter Name" />
</div>
</div>
<div class="form-group row align-items-center justify-content-center">
<label style="font-family:Lato; font-size:20pt; font-weight:normal;" for="name" class="col-sm-4 control-label col text-left">Email:</label>
<div class="col-sm-5 ">
<input id="name" class="form-control input-lg row align-items-left justify-content-left" type="text" placeholder="Enter Your Email Address" />
</div>
</div>
<div class="form-group row align-items-center justify-content-center">
<label style="font-family:Lato; font-size:20pt; font-weight:normal;" for="name" class="col-sm-2 control-label col text-left " >Food Date:</label>
<div class="col-sm-3">
<input id="name" class="form-control input-lg row align-items-center justify-content-left" type="password" placeholder="Start Food" />
</div>
<label style="font-family:Lato; font-size:20pt; font-weight:normal;" for="name" class="col-sm-2 control-label col text-left " >To</label>
<div class="col-sm-3">
<input id="name" class="form-control input-lg row align-items-center justify-content-left" type="password" placeholder="End Food" />
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary">Create</button>
</div>
</div>
</div>
</div>
</div>

Bootstrap classes not being applied on modal window elements

I am working on a bootstrap modal form window. The window appears on desired click but the no styles(classes) appear on them. I mean the whole design is disturbed with no colors and no alignments. Can anyone let me know what can be improved? I am posting my code here for modal window. I am not sure if I am leaving something vital,I have already spent some 2-3 hours on this and still clueless.
<style>
.modal-notify .modal-header {
border-radius: 3px 3px 0 0;
}
.modal-notify .modal-content {
border-radius: 3px;
}
</style>
<div class="modal fade" id="orangeModalSubscription" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
aria-hidden="true">
<div class="modal-dialog modal-notify modal-warning" role="document">
<!--Content-->
<div class="modal-content">
<!--Header-->
<div class="modal-header text-center">
<h4 class="modal-title white-text w-100 font-weight-bold py-2">Subscribe</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true" class="white-text">×</span>
</button>
</div>
<!--Body-->
<div class="modal-body">
<div class="md-form mb-5">
<i class="fas fa-user prefix grey-text"></i>
<input type="text" id="form3" class="form-control validate">
<label data-error="wrong" data-success="right" for="form3">Name</label>
</div>
<div class="md-form">
<i class="fas fa-envelope prefix grey-text"></i>
<input type="email" id="form2" class="form-control validate">
<label data-error="wrong" data-success="right" for="form2">Email</label>
</div>
<div class="md-form">
<i class="fas fa-envelope prefix grey-text"></i>
<input type="mobile" id="form2" class="form-control validate">
<label data-error="wrong" data-success="right" for="form2">Mobile</label>
</div>
</div>
<!--Footer-->
<div class="modal-footer justify-content-center">
<a type="button" class="btn btn-outline-warning waves-effect">Send <i class="fas fa-paper-plane-o ml-1"></i></a>
</div>
</div>
<!--/.Content-->
</div>
</div>`
have you included bootstrap css in the page ?
You need to include bootstrap in you HTML page, inside your <head></head> tag:
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
You can use this code
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<title>Hello, world!</title>
<style type="text/css">
body {
margin: 0;
padding: 0;
}
.modal-notify .modal-header {
border-radius: 3px 3px 0 0;
}
.modal-notify .modal-content {
border-radius: 3px;
}
.fade:not(.show) {
opacity: 1;
}
.modal {
position: fixed;
top: 0;
left: 0;
z-index: 1050;
display: block;
width: 100%;
height: 100%;
overflow: hidden;
outline: 0;
}
</style>
</head>
<body>
<div class="modal fade" id="orangeModalSubscription" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog modal-notify modal-warning" role="document">
<!--Content-->
<div class="modal-content">
<!--Header-->
<div class="modal-header text-center">
<h4 class="modal-title white-text w-100 font-weight-bold py-2">Subscribe</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true" class="white-text">×</span>
</button>
</div>
<!--Body-->
<div class="modal-body">
<div class="md-form mb-5">
<i class="fas fa-user prefix grey-text"></i>
<input type="text" id="form3" class="form-control validate">
<label data-error="wrong" data-success="right" for="form3">Name</label>
</div>
<div class="md-form">
<i class="fas fa-envelope prefix grey-text"></i>
<input type="email" id="form2" class="form-control validate">
<label data-error="wrong" data-success="right" for="form2">Email</label>
</div>
<div class="md-form">
<i class="fas fa-envelope prefix grey-text"></i>
<input type="mobile" id="form2" class="form-control validate">
<label data-error="wrong" data-success="right" for="form2">Mobile</label>
</div>
</div>
<!--Footer-->
<div class="modal-footer justify-content-center">
<a type="button" class="btn btn-outline-warning waves-effect">Send <i class="fas fa-paper-plane-o ml-1"></i></a>
</div>
</div>
<!--/.Content-->
</div>
</div>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
</body>
</body>
</html>

Bootstrap multiple dropdown buttons not displaying properly

I have searched on the internet and even on this site for the answers but no luck. The problem I am having is the two dropdown button sign in and sign up are displaying both dropdown menu when there are clicked I used the btn-group class to fix this but then the problem arises it doesn't display properly on smaller mobile screens changing it to btn class fixes it just a bit then the issue is the options are displaying horizontally and not being stacked which looks awful. I also tried data-target but that isn't working either any help would be appreciated. Here is a sample of my html and css code.
Code
.navbar {
background-color: #00CED1;
border: none;
}
.navbar-default .navbar-brand {
color: white;
font-family: Tahoma;
font-size: 20px;
font-style: italic;
}
.navbar-left {
width: 70%;
margin-left: -15px;
}
#navForm {
border: none;
}
#loginbtn {
margin-right: 16px;
background: none;
color: white;
border: 2px solid white;
}
#searchbtn {
margin-left: -13px;
background-color: #00b3b3;
color: white;
border-color: #00b3b3;
}
#submitbtn {
width: 100%;
}
#burgerbtn:hover {
background-color: #1673b1;
}
#searchbtn:hover {
background-color: #1673b1;
border-color: #1673b1;
}
#search {
width: 100%;
background-color: #00b3b3;
border: none;
color: white;
}
#password,
#username {
margin-top: 15px;
}
b,
strong {
color: #1673b1;
}
#form {
border: none;
}
#navdiv {
border: none;
}
#form2 input::placeholder {
color: white;
}
#form input::placeholder {
color: white;
}
.navbar-default .navbar-toggle .icon-bar {
background-color: white;
}
.dropdown-menu {
padding-left: 15px;
padding-right: 15px;
}
#media screen and (max-width: 720px) {
b,
strong {
position: absolute;
top: 0.5%;
left: 35%;
}
#navdiv {
width: 80%;
}
.navbar-toggle {
border: none;
}
#navdiv {
width: 165%;
}
.navbar-left {
width: 100%;
}
#loginbtn {
margin-left: 5%;
}
}
#navdiv1 {
border: 1px solid black;
}
<!DOCTYPE html>
<html lang="en">
<head>
<title>LearnLyte Connect Share Learn</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="css/app-bootstrap.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#"><strong><font color="white">LearnLyte</font></strong></a>
<button id="burgerbtn" type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navForm">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div id="navdiv" class="navbar-left navbar-form">
<form id="form">
<div class="form-group col-xs-6">
<input id="search" type="text" class="form-control" placeholder="Search Here...">
</div>
<button type="submit" id="searchbtn" class="btn btn-default">Search</button>
</form>
</div>
<div class="navbar-right form-inline">
<div class=" collapse navbar-collapse navbar-form" id="navForm">
<!--<div>-->
<button id="signupbtn" type="button" class="btn dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Sign Up</button>
<div class="dropdown-menu">
<div class="text-center">
<h4><b> Sign Up</b></h4>
</div><br>
<form autocomplete="off">
<div class="form-group">
<label for="firstname">Firstname</label>
<input type="text" id="firstname" tabindex="1" class="form-control" placeholder="Firstname">
</div>
<div class="form-group">
<label for="lastname">Lastname</label>
<input type="text" id="lastname" tabindex="2" class="form-control" placeholder="Lastname">
</div>
<div class="form-group">
<label for="username">Username</label>
<input type="text" tabindex="3" class="form-control" placeholder="Username">
</div>
<div class="form-group">
<label for="email">Email</label>
<input type="email" tabindex="4" class="form-control" placeholder="Email">
</div>
</form>
</div>
<!--</div>-->
<!--<div>-->
<button id="loginbtn" type="button" class="btn dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> Sign In</button>
<div class="dropdown-menu">
<div class="text-center">
<h4><b> Sign In</b></h4>
</div><br>
<form autocomplete="off">
<div class="form group">
<label for="username">Username</label>
<input type="text" id="username" tabindex="1" class="form-control" placeholder="Username" autocomplete="off">
</div>
<div class="form-group">
<label for="password">Password</label>
<input type="password" id="password" tabindex="2" class="form-control" placeholder="Password" autocomplete="off">
</div>
<br>
<div class="form-group">
<div class="text-center">
Forgot password?
</div>
</div>
<br><br>
<div>
<button id="submitbtn" type="submit" class="btn btn-primary btn-block">Sign In</button>
</div>
</form>
</div>
<!--</div>-->
</div>
</div>
</div>
</nav>
<script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/bootstrap.js"></script>
</body>
</html>
Try this
<!DOCTYPE html>
<html lang="en">
<head>
<title>LearnLyte Connect Share Learn</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#"><strong><font color="white">LearnLyte</font></strong></a>
<button id="burgerbtn" type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navForm">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div id="navdiv" class="navbar-left navbar-form">
<form id="form">
<div class="input-group">
<input id="search" type="text" class="form-control" placeholder="Search Here...">
<span class="input-group-btn">
<button type ="submit" id="searchbtn"class="btn btn-default">Search</button>
</span>
</div>
</form>
</div>
<div class="navbar-right form-inline">
<div class=" collapse navbar-collapse navbar-form" id="navForm">
<!--<div>-->
<button id="signupbtn" type="button" class="btn dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Sign Up</button>
<div class="dropdown-menu">
<div class="text-center">
<h4><b> Sign Up</b></h4>
</div>
<br>
<form autocomplete="off">
<div class="form-group">
<label for="firstname">Firstname</label>
<input type="text" id="firstname" tabindex="1" class="form-control" placeholder="Firstname">
</div>
<div class="form-group">
<label for="lastname">Lastname</label>
<input type="text" id="lastname" tabindex="2" class="form-control" placeholder="Lastname">
</div>
<div class="form-group">
<label for="username">Username</label>
<input type="text" tabindex="3" class="form-control" placeholder="Username">
</div>
<div class="form-group">
<label for="email">Email</label>
<input type="email" tabindex="4" class="form-control" placeholder="Email">
</div>
</form>
</div>
<!--</div>-->
<!--<div>-->
<button id="loginbtn" type="button" class="btn dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> Sign In</button>
<div class="dropdown-menu">
<div class="text-center">
<h4><b> Sign In</b></h4>
</div>
<br>
<form autocomplete="off">
<div class="form group">
<label for="username">Username</label>
<input type="text" id="username" tabindex="1" class="form-control" placeholder="Username" autocomplete="off">
</div>
<div class="form-group">
<label for="password">Password</label>
<input type="password" id="password" tabindex="2" class="form-control" placeholder="Password" autocomplete="off">
</div>
<br>
<div class="form-group">
<div class="text-center">
Forgot password?
</div>
</div>
<br>
<br>
<div>
<button id="submitbtn" type="submit" class="btn btn-primary btn-block">Sign In</button>
</div>
</form>
</div>
<!--</div>-->
</div>
</div>
</div>
</nav>
<script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</body>
</html>

Bootstrap modal height and width is not getting accurate

I am using bootstrap modal but the problem is that the bootstrap modal is not properly aligned according to the forms. Please find the screenshot of
And here the code is :
.modal.fade .modal-header {
background-color: rgba(131, 72, 172, 0.8);
color: #FFF;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div class="modal fade " id="myModal" tabindex="-1" style="display:none;" role="dialog" aria-labelledby="myModal" aria-hidden="false">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only"></span></button>
<h4 class="modal-title" id="myModalLabel" align="center">Quick Enquiry</h4>
</div>
<div class="modal-body">
<p>Please fill up the form for Quick Enquiry.</p>
</div>
<div class="modal-body">
<div class="span12">
<form method="post" enctype="multipart/form-data" action="email_format.php">
<input type="text" style="width: 300px; height: 40px;" class="form-control" required name="name" value="" placeholder="Full Name">
<br>
<input type="email" id="reqDate" style="width: 300px; height: 40px;" class="form-control" name="email" placeholder="Email" required>
<br>
<input type="text" id="reqDate" style="width: 300px; height: 40px;" class="form-control" required name="website" placeholder="Website">
<br>
<input type="text" id="reqDate" style="width: 300px; height: 40px;" class="form-control" required name="phone" placeholder="Phone">
<br>
<input type="text" id="reqDate" style="width: 300px; height: 40px;" class="form-control" required name="msg" placeholder="Questions?">
</div>
<div class="col-md-6">
<p style="font-size:11px; line-height:20px;"> <input type="checkbox" checked /> I accept SEO_Faceup Terms & Conditions.</p>
</div>
<div class="modal-footer">
<button type="submit" name="questions" class="thm-btn b-inner font-8">Submit</button></div>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
QUICK ENQUIRY</div>
And I tried to reduce the width of the modal by css using .modal { width: 350px; } but the popup is not coming in center.
Thanks in advance.
To answer your question directly, add style="width: 350px; margin: 0 auto;" to the .modal-body class. On a side note, i recommend that you use classes instead of inline styles.
.modal.fade .modal-header { background-color:rgba(131,72,172, 0.8); color:#FFF;}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div class="modal fade " id="myModal" tabindex="-1" style="display:none;" role="dialog" aria-labelledby="myModal" aria-hidden="false">
<div class="modal-dialog" style="width: 320px; margin: 0 auto;">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only"></span></button>
<h4 class="modal-title" id="myModalLabel" align="center">Quick Enquiry</h4>
</div>
<div class="modal-body" style="width: 100%; margin: 0 auto;">
<p>Please fill up the form for Quick Enquiry.</p>
<div class="span12">
<form method="post" enctype="multipart/form-data" action="email_format.php">
<input type="text" style="height: 40px;" class="form-control" required name="name" value="" placeholder="Full Name">
<br>
<input type="email" id="reqDate" style="height: 40px;" class="form-control" name="email" placeholder="Email"required>
<br>
<input type="text" id="reqDate" style="height: 40px;" class="form-control" required name="website" placeholder="Website">
<br>
<input type="text" id="reqDate" style="height: 40px;" class="form-control" required name="phone" placeholder="Phone">
<br>
<input type="text" id="reqDate" style="height: 40px;" class="form-control" required name="msg" placeholder="Questions?">
</div>
<div class="col-md-6">
<p style="font-size:11px; line-height:20px;"> <input type="checkbox" checked /> I accept SEO_Faceup Terms & Conditions.</p>
</div>
<div class="modal-footer">
<button type="submit" name="questions" class="thm-btn b-inner font-8" >Submit</button></div>
</div>
</div>
</div>
</div></div>
</form>
</div>
QUICK ENQUIRY</div>
Try this, and remember HTML is your friend ;)
.modal.fade .modal-header {
background-color: rgba(131, 72, 172, 0.8);
color: #FFF;
}
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<div class="modal fade " id="myModal" tabindex="-1" style="display:none;" role="dialog" aria-labelledby="myModal" aria-hidden="false">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span><span class="sr-only"></span></button>
<h4 class="modal-title" id="myModalLabel" align="center">Quick Enquiry</h4>
</div>
<div class="modal-body">
<p><center>Please fill up the form for Quick Enquiry.</center></p>
</div>
<div class="modal-body">
<center>
<div class="span12">
<form method="post" enctype="multipart/form-data" action="email_format.php">
<input type="text" style="width: 300px; height: 40px;" class="form-control" required name="name" value="" placeholder="Full Name">
<br>
<input type="email" id="reqDate" style="width: 300px; height: 40px;" class="form-control" name="email" placeholder="Email" required>
<br>
<input type="text" id="reqDate" style="width: 300px; height: 40px;" class="form-control" required name="website" placeholder="Website">
<br>
<input type="text" id="reqDate" style="width: 300px; height: 40px;" class="form-control" required name="phone" placeholder="Phone">
<br>
<input type="text" id="reqDate" style="width: 300px; height: 40px;" class="form-control" required name="msg" placeholder="Questions?">
<center>
</div>
<div class="col-md-6">
<p style="font-size:11px; line-height:20px;"> <input type="checkbox" checked /> I accept SEO_Faceup Terms & Conditions.</p>
</div>
<div class="modal-footer">
<button type="submit" name="questions" class="thm-btn b-inner font-8">Submit</button></div>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
QUICK ENQUIRY</div>