Bootstrap modal height and width is not getting accurate - html

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>

Related

Move button to center

I was wondering if someone knows how can I move this button slightly to the left so it goes straight to the center. This is the code:
<!-- Modal for Contact - us Button -->
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="exampleModalLabel">Contáctanos</h4>
</div>
<div class="modal-body">
<form action="https://formsubmit.co/myemail.com" method="POST">
<div class="form-group">
<label for="Name">Nombre</label>
<input type="text" class="form-control" id="Name" placeholder="Nombre" required>
</div>
<div class="form-group">
<label for="Phone">Celular</label>
<input type="tel" class="form-control" id="phone" placeholder="Celular" required>
</div>
<div class="form-group">
<label for="Email">Correo</label>
<input type="Email" class="form-control" id="Email-1" placeholder="Correo" required></textarea>
</div>
<div class="form-group">
<label for="Message">Mensaje</label>
<textarea class="form-control" id="Message" placeholder="Ingresa tu mensaje" required></textarea>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-success" style="margin:0;display:block;width:100%">Enviar</button>
</div>
</form>
</div>
</div>
</div>
</div>
here a picture of what I'm trying to say: https://imgur.com/204WlVD Hope someone can help me out, thanks!
It is hard to tell what you need to do without seeing the css, but I think that if you adjust the padding-left on the modal-footer class you should be able to move the button to the right. If you could upload what your css classes look like, that would be very helpful.
You can apply below css:
text-align: center;
margin: 0 auto;
<div class="modal-footer">
<button type="submit" class="btn btn-success" style="margin:0;display:block;width:100%">Enviar</button>
</div>
Just Use this one line style
<div class="modal-footer" style="justify-content: space-around;">
<button type="submit" class="btn btn-success">Enviar</button>
</div>
Try changing the button CSS:
.btn-success { margin: 0 auto; }

Bootstrap Modal Form: Rows are not under the first row

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>

How to divide html page

I want to make a html page with three sections and inside each section divide it to left and right. In each section I have three boxes and I want to put two boxes on the left and one box on the right following is the css and html code:
.leftbox {
width: 50%;
padding: 5px;
float: left;
}
.rightbox {
width: 50%;
padding: 5px;
float: right;
}
<div id="rotationFormPopup" class="rotationFormPopup" style="width: 900px; display: none; background: #FFF; border: 1px solid; padding: 10px; margin-top: 100px;">
<h2 class="popup-header">Rotation Forms</h2>
<div class="newRotation-sections">
<h3>Details</h3>
<div class="newRotation-section-1" style="margin-top: 10px;">
<div class="leftbox">
<span>Mob</span> <br />
<input type="text" class="newRotation-mob" style="width: 100%;"><br /><br />
<span>Paddock</span> <br />
<input type="text" class="newRotation-paddock" style="width: 100%;"><br /><br />
</div>
<div class="rightbox">
<span>Date</span> <br />
<input type="text" class="newRotation-date" style="position: relative; display: inline-block; float: left; width: 100%; margin-top: 10px;"><br /><br />
</div>
</div>
<h3>Fencing options</h3>
<div class="newRotation-section-2" style="margin-top: 10px;">
<div class="leftbox">
<span>Available Today</span> <br />
<input type="text" class="newRotation-available" style="width: 100%;"><br /><br />
<span>Paddock Allocation %</span> <br />
<input type="number" class="newRotation-alloc" value="50" style="width: 100%;"><br /><br />
</div>
<div class="rightbox">
<span>Required Result</span> <br />
<input type="text" class="newRotation-result" style="width: 100%;"><br /><br />
</div>
</div>
<h3>Assign As Task</h3>
</div>
</div>
</div>
I receive the below result, I don't know why the fencing options jump to the right side.
Here is the image of my work:
I wrote up this using the Bootstrap Framework. It matches your image exactly.
There's a Codepen if you want to fork and play around with it. It's responsive, too.
/* Roboto Font */
#import url('https://fonts.googleapis.com/css?family=Roboto');
html, body {
height: 100%;
}
body {
font-family: 'Roboto', sans-serif;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" type="text/css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.bundle.min.js"></script>
<div class="container p-5">
<div class="row">
<div class="col-sm-12">
<h5 class="title text-uppercase bg-success text-white p-1">Rotation Forms</h5>
<h4 class="mb-3 mt-3">Details</h4>
</div>
<div class="col-sm-12 col-md-6">
<div class="form-group">
<label for="mob">Mob</label>
<input type="text" class="form-control" id="mob" placeholder="Enter Mob">
</div>
<div class="form-group">
<label for="paddock">Paddock</label>
<input type="text" class="form-control" id="paddock" placeholder="Enter Paddock">
</div>
</div>
<div class="col-sm-12 col-md-6">
<div class="form-group">
<label for="date">Date</label>
<input type="date" class="form-control" id="date" placeholder="Enter Date">
</div>
<h4 class="mb-3 mt-3">Fencing Options</h4>
<div class="form-group">
<label for="avail">Available Today</label>
<input type="text" class="form-control" id="avail" placeholder="NaN">
</div>
<div class="form-group">
<label for="allocation">Paddock Allocation %</label>
<input type="number" class="form-control" id="allocation" placeholder="100">
</div>
<div class="form-group">
<label for="result">Required Result</label>
<input type="text" class="form-control" id="result" placeholder="NaN">
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12 col-md-6">
<h4 class="mb-3 mt-3">Assign As Task</h4>
<div class="form-group">
<label for="assign">Assign to</label><br>
<button type="submit" class="btn btn-success btn-md" id="assign">Add</button>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="checked">
<label class="form-check-label" for="checked">I want to see this too.</label>
</div>
<button type="button" class="btn btn-success btn-md">Save</button>
<button type="button" class="btn btn-success btn-md">Cancel</button>
</div>
</div>
</div>

Modal window not closing from button

I am using a custom modal window with a form and cannot close the window from a button. I have tried various options of data-dismiss but still not working. I am launching the modal from a menu click on within a li element like so:
<li>Contact</li>
Is this correct?
I am also confused as to why the window closes when the ;times x is clicked. As I am a new user to html5 I would be grateful if someone could help with this. many thanks
Bootstrap v3.3.7
html
<div class="modal" id="modal" role="dialog">
<div class="modal__dialog">
<section class="modal__content">
<header class="modal__header">
<h2 class="modal__title"><div style="margin: 0 0 0 30px;">Contact Us</div></h2>
<div style="margin: 4px 0 0 34px; color: white;">If you need to contact us, please use this form and we shall respond as soon as possible. Thanks</div>
×
</header>
<div class="modal__body">
<div class="content-block contact-3">
<div class="container">
<div class="row">
<div class="col-md-8">
<div id="contact" class="form-container">
<fieldset>
<div id="message"></div>
<form method="post" action="js/contact-form.php" name="contactform" id="contactform">
<div class="form-group">
<input name="name" id="name" type="text" value="" placeholder="Name" class="form-control" />
</div>
<div class="form-group">
<input name="email" id="email" type="text" value="" placeholder="Email" class="form-control" />
</div>
<div class="form-group">
<input name="phone" id="phone" type="text" value="" placeholder="Phone" class="form-control" />
</div>
<div class="form-group">
<textarea name="comments" id="comments" class="form-control" rows="3" placeholder="Message" id="textArea"></textarea>
<div class="editContent">
<p class="small text-muted"><span class="guardsman">* All fields are required.</span> Once we receive your message we will respond as soon as possible.</p>
</div>
</div>
<div class="form-group">
<button class="btn btn-default" type="button" class="modal" data-dismiss="modal">Close</button>
<button class="btn btn-primary" type="submit" id="cf-submit" name="submit">Send</button>
</div>
</form>
</fieldset>
</div>
<!-- /.form-container -->
</div>
</div>
<!-- /.row -->
</div>
<!-- /.container -->
</div>
<!--// END Contact 3-1 -->
</div>
</section>
</div>
You need to add data-toggle="modal" and data-target="#modal" attributes to your link.
You need to add data-dismiss="modal" attribute to your close link.
See my fiddle and read the documentation:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.css" rel="stylesheet" />
<li><a data-toggle="modal" data-target="#modal">Contact</a></li>
<div class="modal" id="modal" role="dialog">
<div class="modal__dialog">
<section class="modal__content">
<header class="modal__header">
<h2 class="modal__title">
<div style="margin: 0 0 0 30px;">Contact Us</div>
</h2>
<div style="margin: 4px 0 0 34px; color: white;">If you need to contact us, please use this form and we shall respond as soon as possible. Thanks</div>
×
</header>
<div class="modal__body">
<div class="content-block contact-3">
<div class="container">
<div class="row">
<div class="col-md-8">
<div id="contact" class="form-container">
<fieldset>
<div id="message"></div>
<form method="post" action="js/contact-form.php" name="contactform" id="contactform">
<div class="form-group">
<input name="name" id="name" type="text" value="" placeholder="Name" class="form-control" />
</div>
<div class="form-group">
<input name="email" id="email" type="text" value="" placeholder="Email" class="form-control" />
</div>
<div class="form-group">
<input name="phone" id="phone" type="text" value="" placeholder="Phone" class="form-control" />
</div>
<div class="form-group">
<textarea name="comments" id="comments" class="form-control" rows="3" placeholder="Message" id="textArea"></textarea>
<div class="editContent">
<p class="small text-muted"><span class="guardsman">* All fields are required.</span> Once we receive your message we will respond as soon as possible.</p>
</div>
</div>
<div class="form-group">
<button class="btn btn-default" type="button" class="modal" data-dismiss="modal">Close</button>
<button class="btn btn-primary" type="submit" id="cf-submit" name="submit">Send</button>
</div>
</form>
</fieldset>
</div>
<!-- /.form-container -->
</div>
</div>
<!-- /.row -->
</div>
<!-- /.container -->
</div>
<!--// END Contact 3-1 -->
</div>
</section>
</div>
The reference in calling the modal seems to be wrong. Other than that, modal is working perfectly. Try this snippet.
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<div class="row text-center">
Contact
</div>
<div class="modal fade" id="largeModal" tabindex="-1" role="dialog" aria-labelledby="largeModal" aria-hidden="true">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h2 class="modal__title">
<div style="margin: 0 0 0 30px;">Contact Us</div>
</h2>
<div style="margin: 4px 0 0 34px; color: white;">If you need to contact us, please use this form and we shall respond as soon as possible. Thanks</div>
</div>
<div class="modal-body">
<div class="content-block contact-3">
<div class="container">
<div class="row">
<div class="col-md-8">
<div id="contact" class="form-container">
<fieldset>
<div id="message"></div>
<form method="post" action="js/contact-form.php" name="contactform" id="contactform">
<div class="form-group">
<input name="name" id="name" type="text" value="" placeholder="Name" class="form-control" />
</div>
<div class="form-group">
<input name="email" id="email" type="text" value="" placeholder="Email" class="form-control" />
</div>
<div class="form-group">
<input name="phone" id="phone" type="text" value="" placeholder="Phone" class="form-control" />
</div>
<div class="form-group">
<textarea name="comments" id="comments" class="form-control" rows="3" placeholder="Message" id="textArea"></textarea>
<div class="editContent">
<p class="small text-muted"><span class="guardsman">* All fields are required.</span> Once we receive your message we will respond as soon as possible.</p>
</div>
</div>
<div class="form-group">
<button class="btn btn-default" type="button" class="modal" data-dismiss="modal">Close</button>
<button class="btn btn-primary" type="submit" id="cf-submit" name="submit">Send</button>
</div>
</form>
</fieldset>
</div>
<!-- /.form-container -->
</div>
</div>
<!-- /.row -->
</div>
<!-- /.container -->
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
If you are using bootstrap modals you can read their docs. You are using the example buttons:
<div class="form-group">
<button class="btn btn-default" type="button" class="modal" data-dismiss="modal">Close</button>
<button class="btn btn-primary" type="submit" id="cf-submit" name="submit">Send</button>
</div>
The data-dismiss="modal" is what makes the modal to close, so you could make your link like this:
×

Bootstrap modal form is so ugly

I need help i cant figure out why my modal login form is not conforming to any changes and doesn't look like the standard bootstrap form.
nav.php
<!-- Modal HTML -->
<div id="myModal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Login</h4>
</div>
<div class="modal-body">
<p>Please log in below</p>
<form action="#" method="post" accept-charset="UTF-8">
<div class="row">
<div class="col-lg-4 col-md-4 col-sm-4">
<label class="label" for="user" style="color: black">Username</label></br>
<input id="user" type="text" name="user" size="30" class="input-large" placeholder="username" required/>
</div>
</div>
<div class="row">
<div class="col-lg-4 col-md-4 col-sm-4">
<label class="label" for="pass"style="color: black">Password</label></br>
<input id="pass" type="text" name="pass" size="30" class="input-large" placeholder="Password"required/>
</div>
</div>
<label class="string optional" for="user_remember_me"> Remember me</label> <input id="user_remember_me" style="float: left; margin-right: 10px;" type="checkbox" name="user[remember_me]" value="1" />
<input class="btn btn-success" style="clear: left; width: 100%; height: 32px; font-size: 13px; margin-bottom: 6px;" type="submit" name="submit" value="submit" />
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
here is what it looks like
here is an example of what i want it to look like
The documentation is your friend. Forms, inputs, and their labels need form-group and form-control (among other classes) attached to them.
<form>
<div class="form-group">
<label for="exampleInputEmail1">Email address</label>
<input type="email" class="form-control" id="exampleInputEmail1" placeholder="Email">
</div>
</form>