Ordering does not work on Bootstrap 4 - css

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/

Related

Bootstrap two column misalignment

I am trying to create a simple two column layout, but for some reason, some of the cells get skipped. (see: https://imgur.com/a/FE2ZwKY). I am using Laravel to get the products from the DB using a foreach loop. The code for one product looks like this:
<div class="col-md-6 mt-4">
<div class="card">
<img src="{{asset('storage/app/public/cover_images/'.$product->cover_image)}}" class="img-fluid" alt="">
<div class="card-content">
<div class="row">
<div class="col-md-6">
<h6 class="text-center">ROMÂNĂ</h6>
<h4 class="mt-4 text-center">
<b>{{$product->name_ro}}</b></h4>
<p>{{$product->desc_ro}}</p>
</div>
<div class="col-md-6">
<h6 class="text-center">ENGLISH</h6>
<h4 class="mt-4 text-center">
<b>{{$product->name_en}}</b></h4>
<p>{{$product->desc_en}}</p>
</div>
</div>
<h5 class="text-center">Pret: <b>{{$product->price}}</b>
</h5>
<hr>
<div class="button-wrapper">
<a href="{{url('/products/'.$product->id.'/edit/')}}">
<button type="submit" class="btn btn-warning">Editeaza</button></a>
<form action="{{ action('ProductsController#destroy', $product->id) }}" method="post">
#csrf
<input name="_method" type="hidden" value="DELETE">
<button type="submit" class="btn btn-danger">Sterge</button>
</form>
</div>
</div>
</div>
The code above is generated for every product there is. Any help is welcome, thanks!
a problem could be, that your <h4> text is not always the same length.
The headlines are pushing the content, and the cards are receiving different height values.
If you set a fixed height for h4, your problem is maybe solved.

Input type file breaks container causing horizontal scroll (bootstrap 4 beta)

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-->

How to widen bootstrap 3 input box

I'm working with bootstrap 3 and trying to piece together a base layout for a flask app. so far I have:
<div class="container">
<div class="row">
<div class="col-xs-12">
<div class="content">
<div class="pull-middle">
<h1 class="page-header">Create an awesome App template with Bootstrap.</h1>
<div class="container">
{% block content %}
{% endblock %}
</div>
<div class="row">
<div class="col-xs-12 col-md-8 col-md-offset-2 col-lg-4 col-lg-offset-4">
<div class="panel panel-default ">
<div class="panel-body ">
<form action="#" role="form">
<div class="input-group ">
<input type="email" class="form-control" placeholder="Email Address" required>
<span class="input-group-btn">
<button class="btn btn-success btn-circle" type="submit">Sign up for free</button>
</span>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<footer class="footer text-center">
<div class="container">
<small>© Copyright 2015. </small>
</div>
</footer>
I want to widen the email address form, leaving the green button as is. How can I do this?
You are using the Bootstrap Grid classes wrong.
The input fielding is getting space what it has been given by parent div using the grid class col-lg-4 making it col-lg-6 would give more space to it's child divs.
So using these classes would help textfield to take more space.
col-xs-12 col-md-8 col-md-offset-2 col-lg-6 col-lg-offset-3

Overlapping columns after resizing in Bootstrap 3.0

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

Sections invisible until window resize

I cant get sections to work properly, they are invisible until a window resize.
foundation.css:2413 code at this line setting section-container to visibility:hidden
I copied the actual code but even examples doesnt work in that containing divs.
<div class="large-8 columns large-centered">
<form class="custom ajaxform" data-validate="parsley" method="post" action="formProcess">
<input type="hidden" name="formtype" value="test" >
<fieldset>
<legend>Test</legend>
<span class="icon24 icon-close"></span>
<h4><small>Test</small></h4>
<?= View::make('forms.header') ?>
<h4><small>Test</small></h4>
<div class="section-container tabs" data-section="tabs">
<section class="active">
<p class="title" data-section-title>Test</p>
<div class="content" data-section-content>
<div class="row">
<div class="large-4 columns">
<label>Test *</label>
<input type="text" name="test" data-required="true">
</div>
</div>
</div>
</section>
<section>
<p class="title" data-section-title>test Tab 2</p>
<div class="content" data-section-content>
<div class="row">
<div class="large-6 columns">
<label>Second *</label>
<input type="text" name="second" data-required="true">
</div>
</div>
</div>
</section>
</div>
<div class="row">
<div class="large-12 columns">
<button class="small radius button" style="float:right" type="submit">Submit</button>
</div>
</div>
</fieldset>
</form>
</div>
Probably because you were adding the sections programmatically. In that case, you need to force a resize, so that foundation will be triggered to draw them correctly.
I had the same problem, and after quick googling, this would solve it:
$('[data-section]').trigger('resize');
If a
<div>
is not visible then it may means that it doesn't have a well defines height and width. Then rendering a content is not meaningful. To avoid that flaw we have to add a height and width.
<div class="section-container tabs" data-section="tabs" style="height: 400px; width : 400px;"></div>
Mention your respective height and width.

Resources