Why in the following Bootstrap 3.0 sample the right panel hides completely the form when I reduce the width of the browser?
<div class="row">
<div class="col-sm-9">
<h2>Product selection</h2>
<p>Some text</p>
<hr />
<form action="/Store" class="form-horizontal" id="productForm" method="post" role="form">
<div class="form-group">
<label class="col-md-2 control-label" for="Quantity">Quantity</label>
<div class="col-md-10">
<input class="form-control" id="quantity" name="quantity" onchange="this.form.submit();" type="text" value="1" />
</div>
</div>
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<input name="nextButton" type="submit" class="btn btn-default" value="Next" />
</div>
</div>
</form>
</div>
<div class="col-md-3" style="margin-top: 20px">
<div class="panel panel-default">
<div class="panel-heading">Your Options</div>
<div class="panel-body">
<p style="line-height: 200%">
Other ways to buy<br/>
</p>
</div>
</div>
</div>
Here is a live test of what happens:
http://www.bootply.com/R4FsSHI4af
To reproduce it you need simply to reduce the width of the browser window.
Thanks.
You are mixing col-sm-9 with col-md-3. Just use one size, for example col-md-9 and col-md-3.
Use this structure instead :
<div class="row">
<div class="col-md-9">
<!-- Content -->
</div>
<div class="col-md-3">
<!-- Panel -->
</div>
</div>
As you're mixing col-sm-9 and col-md-3, you've got :
a 12-12 pattern on small devices
a 9-12 pattern on medium devices : overlap
a 9-3 pattern on large and extra large devices
Related
I want to different order on Desktop and on mobile,
Currently this is the order
On Med+ :
On small:
Desktop is good. This is the right position.
On mobile I want the picture to come below the button and the test.
I have tried order-sm-fist and order-sm-last and also order-1 until order-2 but nothing seems to change. Not sure what I am doing wrong:
<section class="feature section">
<div class="container">
<div class="row">
<div class="heading">
<h2>Try it now!</h2>
</div>
<div class="col-md-5 order-md-last">
<img src="The image url is here"
class="" id="generated-monKey" alt="">
</div>
<div class="col md-2 order-md-1">
<br>
</div>
<div class="col-md-5 order-md-first text-center">
<p>Enter a Banano wallet address and press the "Generate monKey" button.</p>
<br>
<p>If you do not have a Banano wallet you can create one in BananoVault or simply generate a random Banano
wallet address.</p>
<br>
<div class="container">
<input type="text" class="form-control form-rounded" placeholder="Banano Address" maxlength="64" size="65">
<br>
<div class="container">
<div class="row">
<form>
<div class="checkbox col-md-6">
<label>
<input type="checkbox" value="" checked>Accessories</label>
</div>
<div class="checkbox col-md-6">
<label>
<input type="checkbox" value="" checked>Background</label>
</div>
</form>
</div>
</div>
</div>
<br>
<button type="button" class="btn btn-lg btn-success form-rounded" border>Generate monKey</button>
<br>
<br> Monkeys are perfect for avatars. Click on the monKey image in order to download it.
</div>
</div>
</div>
</section>
In this example I changed the md to first and last which means even on Desktop I should see the image on the right and the text on the left and yet nothing changes.
Your HTML structure is so messy. Here are my 2 cents:
No nested container
cols should come right after row.
What's up with the missing - on col md-2? And why do you need a column wrapping a <br>?
Cleaned up HTML structure
<section class="feature section">
<div class="container">
<div class="heading"></div>
<div class="row">
<div class="col-md-6">
<form />
</div>
<div class="col-md-6 order-md-first">
<img />
</div>
</div>
</div>
</section>
fiddle: http://jsfiddle.net/aq9Laaew/144878/
I'm trying to create two 6 column divs. The second div has a form that should be 4 columns and centered. Everything works fine until I add the file input to the form. This causes it to break out of the container and adds a horizontal scroll bar at the bottom. I read that changing css for input{overflow:hidden;} would fix this but it did not. I've commented out the input file line so that it can be found easier. Can someone tell me how to keep the file input from breaking outside the box.
<div class="container careers-container">
<div class="row">
<div class="col-12 col-sm-6 mx-auto mt-4">
<h1 class='carbon cyan text-center'>Careers</h1>
<div class="divider background-cyan"></div>
<p class='salmon mt-4 font-24'>The Bridge is a premier pool hall providing an exceptional experience to it's clientele. We have the best tables, a great selection of drinks, good food options and lots of entertainment in a classy atmosphere. We are currently looking for people with service industry experience to serve at our Edmond location.</p>
<div class="container">
<div class="row">
<div class="col-12">
<h2 class='zaffre h5'>Currently Hiring</h2>
</div>
</div>
<div class="row no-gutters">
<div class="col-12 col-sm-4 d-none d-sm-block">
<img src="images/dart-board.jpg" class='img-fluid mb-3'></img>
</div>
<div class="col-12 col-sm-8">
<ul class='list-unstyled zaffre ml-3'>
<li>Bar Manager</li>
<li>Full time bartenders</li>
<li>Part time bartenders</li>
<li>Full or part time cooks</li>
<li>Part time cocktail waitress</li>
</ul>
</div>
</div>
<div class="row">
<div class="col-12 mb-3">
<span class='zaffre h6 font-24'>Please submit your resume here and we will contact you</span>
</div>
</div>
</div>
</div>
<div class="col-12 col-sm-4 mx-auto">
<div class="background-cyan pt-3 pb-3 pl-1 pr-1">
<form>
<div class="form-group row">
<label for="inputName" class="col-sm-2 col-form-label sr-only">Name</label>
<div class="col-12">
<input type="text" class="form-control" id="inputName" placeholder="Full Name">
</div>
</div>
<div class="form-group row">
<label for="tel-input" class="col-sm-2 col-form-label sr-only">Telephone</label>
<div class="col-12">
<input class="form-control" type="tel" value="Phone Number" id="tel-input">
</div>
</div>
<div class="form-group row">
<label for="inputEmail" class="col-sm-2 col-form-label sr-only">EMAIL</label>
<div class="col-12">
<input type="email" class="form-control" id="inputEmail" placeholder="Email">
</div>
</div>
<div class="form-group">
<label class='text-white' for="InputFile">Upload Resume</label>
<!-- <input type="file" class="form-control-file" id="InputFile"/> -->
</div>
<div class="text-center">
<button type="submit" id='submit-btn' class="btn btn-sm btn-secondary mt-5 info-button">Submit Form</button>
</div>
</form>
</div>
</div>
</div>
</div><!--End of container-->
Basically I have something like this
<div class="container">
<div class="row">
<div class="col-md-6>
<form class="form-group-sm">
<input />
<button type="submit"></button>
</form>
</div>
</div>
<div class="col-md-6>
<form class="form-group-sm">
<input />
<button type="submit"></button>
</form>
</div>>
</div>
2 columns side by side, I'm trying to figure out a way to center the forms, input, and button inside each column but cant seem too figure out how.
<form method="POST" action="./createProduct" class="form-group-sm" >
<div class="form-group">
<label for="t" class="col-md-8 control-label">Product Type</label>
<div class="col-md-8">
<input name="productType" id="t"/>
</div>
</div>
<div class="form-group">
<label for="sn" class="col-md-8 control-label">Material Cost PerSqFoot</label>
<div class="col-md-8">
<input name="matCostSqf" id="sn"/>
</div>
</div>
<div class="form-group">
<label for="snum" class="col-md-8 control-label">Labor Cost PerSqFoot</label>
<div class="col-md-8">
<input name="laborCostSqf" id="snum" />
</div>
</div>
<br />
<div class="col-md-8">
<br />
<button class=" btn btn-danger btn-lg center-block" type="submit">Submit</button>
</div>
</form>
Twitter Bootstrap has a default class for that called text-center.
Just add the text-center class to your col- divs like this:
<div class="col-md-6 text-center">
-- your content --
</div>
P.S. You forgot to properly close the column divs. Do make sure you close them always
Your markup contains some errors like an extra closing div and a missing double cotes for the class attribute : class="col-md-6>
here is the solution you can use the bootstrap class "text-center"
<div class="container">
<div class="row">
<div class="col-md-6 text-center">
<form class="form-group-sm">
<input />
<button type="submit">Submit</button>
</form>
</div>
<div class="col-md-6 text-center">
<form class="form-group-sm">
<input />
<button type="submit">Submit</button>
</form>
</div>
</div>
here is a pen
Just started learning Bootstrap and for example have designed this form like this, I want to know if those column numbers even make sense according to each other?
<form class="form-horizontal">
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<div class="checkbox">
<label>
<input type="checkbox"> Website Active
</label>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<label>Display this message when the website is not active</label>
<textarea class="form-control" rows="3" id="comment"></textarea>
</div>
</div>
</div>
</div>
</form>
See here the difference of what I explained in comments :
In your case, a more proper structure could be :
<div class="container">
<div class="row">
<form class="form-horizontal">
<div class="col-sm-6">
<div class="form-group">
<div class="checkbox">
<label>
<input type="checkbox"> Website Active
</label>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label>Display this message when the website is not active</label>
<textarea class="form-control" rows="3" id="comment"></textarea>
</div>
</div>
</form>
</div>
</div>
And you have to add a .container or .container-fluid class around your .row
You can have .row as much as you wants in a single .container class.
See your code on a bootply fiddle
Till now I was using Bootstrap 3.3.1, everything was fine.
http://jsfiddle.net/PKrUC/256/
Then I have to update Bootstrap to the latest version 3.3.6:
http://jsfiddle.net/PKrUC/257/
the buttons are on the wrong side. align="right" seems not working anymore.
I used the files from https://cdnjs.com/libraries/twitter-bootstrap/3.3.6 as extern resources for the jsfiddle.
Anyone know why is this happening and how can I fix it?
You can use 'pull-right' in the individual button classes'
[1]: http://jsfiddle.net/PKrUC/260/
You can simply fix by adding .text-right in to parent element
Fix: http://jsfiddle.net/eycfyvx9/
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<div class="container">
<div class="col-md-4 col-md-offset-4">
<form class="form-horizontal" method="POST" id="packet_form">
<div class="panel panel-info">
<div class="panel-heading">
<div class="row">
<div class="col-xs-12">
<h4 class="pull-left">New Packet</h4>
</div>
</div>
</div>
<div class="panel-body" id="panel_user">
<div class="form-group">
<label class="col-xs-3 control-label" for="date">Expire-Date</label>
<div class="col-xs-6">
<input type="date" id="date" name="date" class="form-control">
</div>
</div>
<div class="form-group">
<label class="col-xs-3 control-label" for="licence_text">Lizence:</label>
<div class="col-xs-9">
<textarea class="form-control" id="licence_text" name="licence_text" rows="20"></textarea>
</div>
</div>
<div class="form-group">
<div class="col-xs-12 text-right">
<a class="btn btn-danger" href="javascript:window.history.back()">Back</a>
<button type="submit" class="btn btn-success" formaction="add_packet.php">Save</button>
</div>
</div>
</div>
</div>
</form>
</div>
</div>