I have a problem that the order-[num] is not working because of the left and right side in different col's
Screenshot of view
<section class="row justify-content-center">
<div class="col-md-11">
<div class="row">
<div class="col-md-5">
<div class="row">
<div class="col-12 mb-3 order-0">
order small 1
</div>
<div class="col-12 mb-3 order-2">
order small 3
</div>
</div>
</div>
<div class="col-md-7">
<div class="row">
<div class="col-12 mb-3 order-1">
Ordering as small 2
</div>
<div class="col-lg-6 mb-3 order-3">
ordering as small 4
</div>
<div class="col-lg-6 mb-3 order-4">
ordering as small 5
</div>
</div>
</div>
</div>
</div>
</section>
if I placed all col's in one row it created a big white space of the height of place 2
I can only think of a solution which duplicates the section 3, puts its copy between 2 and the row of 4 and 5, and show/hide section 3 and its copy based on the break point.
HTML
<div class="container">
<div class="row">
<div class="col-md-5">
<section class="mb-3">
1
</section>
<section class="mb-3 d-none d-md-block">
3
</section>
</div>
<div class="col-md-7">
<section class="mb-3">
2
</section>
<section class="mb-3 d-md-none">
copy of 3
</section>
<div class="row">
<div class="col">
<section class="mb-3">
4
</section>
</div>
<div class="col">
<section class="mb-3">
5
</section>
</div>
</div>
</div>
</div>
</div>
Result
On large screens:
On small screens:
fiddle: http://jsfiddle.net/59x0s17k/1/
Related
I want to make the following layout using bootstrap
my problem is that I do not know how to give div one (1 in picture) following height
Here is a working example : https://codepen.io/pof/pen/abWqgjJ
and the basic layout could look like that :
<div class="row">
<div class="col-6">
Picture 1
</div>
<div class="col-6">
<div class="row">
<div class="col-6">
Picture 2
</div>
<div class="col-6">
Picture 3
</div>
</div>
<div class="row">
<div class="col-6">
Picture 4
</div>
<div class="col-6">
Picture 5
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-6">
<div class="row">
<div class="col-6">
Picture 6
</div>
<div class="col-6">
Picture 7
</div>
</div>
</div>
<div class="col-6">
<div class="row">
<div class="col-6">
Picture 8
</div>
<div class="col-6">
Picture 9
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-6">
<div class="row">
<div class="col-6">
Picture 10
</div>
<div class="col-6">
Picture 11
</div>
</div>
</div>
<div class="col-6">
<div class="row">
<div class="col-6">
Picture 12
</div>
<div class="col-6">
Picture 13
</div>
</div>
</div>
</div>
But maybe I'm missing something... Can you provide your code ? Which version of bootstrap are you using ?
I'm trying to create a template with bootstrap grid system like the image below from medium screen sizes but unable to do so. Below is my code:
HTML:
<div class="container-fluid" style="text-align:center">
<div class="row" style="text-align:center">
<div class="col-md-12" style="font-size:22px">All Blogs </div>
<br><br><br><br>
</div>
<br>
<br>
<div class="row col-md-12 py-3" *ngIf="allBlogs.length>0">
<!-- Card Start -->
<div class="card" *ngFor="let blog of allBlogs">
<div class="row">
<div class="col-md-3">
<a [routerLink]="['/blog', blog.id]"><img src="http://localhost:4000/{{blog.imagePath}}" class="card-img-top card-img-size" alt="blog1"></a>
</div>
<div class="col-md-5 px-3">
<div class="card-block px-6">
<h4 class="card-title">{{blog.title}}</h4>
<p class="card-text">{{blog.description}}</p>
<br>
Read More
</div>
</div>
</div>
</div>
<br>
<app-blog-category></app-blog-category>
</div>
</div>
Here's a template based on the image. I did an 8 and 4 grid size since bootstrap uses the 12 column system but feel free to alter these numbers as needed.
<div class="container-fluid">
<div class="row">
//this col contains your three card rows
<div class="col-md-8">
<div class="row">
<div class="col"> </div>
</div>
<div class="row">
<div class="col"> </div>
</div>
<div class="row">
<div class="col"> </div>
</div>
</div>
//this is for your shared component
<div class="col-md-4">
<shared-component></shared-component>
</div>
</div>
</div>
I want to create this layout. I tried making 2 and 4 div duplicate and showing them on mobile and displaying on desktop and opposite.
This code is working as I expected. But I want to know that is it possible to make it without duplicating the content.
<div class="row">
<div class="col-md-2 col-12">
<img src="http://via.placeholder.com/106x106">
<div class="show-mobile">
<div>content2</div>
<div>content4</div>
</div>
</div>
<div class="col-md-8 col-12">
<div class="show-desktop">
content2
</div>
<div>
content 3
</div>
</div>
<div class="col-md-2 col-12">
<div class="show-desktop">
content 4
</div>
<div>
content 5
</div>
</div>
</div>
This might be a not a perfect solution but visually looks close enough
<div class="container">
<div class="row">
<div class="col-4 col-md-2">
<img src="http://via.placeholder.com/106x106">
</div>
<div class="col-8 col-md-8 bg-light border">
2
</div>
<div class="col-12 col-md-8 offset-md-2 order-2 bg-light border">
3
</div>
<div class="col-8 offset-4 col-md-2 offset-md-0 bg-light border">
4
</div>
<div class="col-12 col-md-2 order-3 bg-light border">
5
</div>
</div>
</div>
I am trying to learn Bootstrap in particular Bootstrap 4 but struggling with my footer.
It has 2 rows and i want the entire thing centered but struggling.
Below is my HTML i currently have
<section class="block-follow-us">
<div class="container">
<div class="row align-items-center justify-content-center">
<div class="col-4 col-md-1 px-0">
<span class="h5">Follow us:</span>
</div>
<div class="offset-1 col-10 offset-md-0 col-md-3 px-0">
</div>
</div>
</div>
</section>
<footer class="footer">
<div class="container-fluid">
<div class="row text-center">
<div class="col-12">© 2019 - Apollo Scientific Ltd</div>
</div>
<div class="row justify-content-center text-center">
<div class="col-12 col-md-2">
Terms and conditions
</div>
<div class="col-12 col-md-2">
Privacy policy
</div>
<div class="col-12 col-md-1">
Careers
</div>
</div>
</div>
</footer>
Which turns out looking like the below on desktop but all parts over the place and i have been trying for hours to sort it
And mobile looks likes fine though
<section class="block-follow-us">
<div class="container">
<div class="row align-items-center justify-content-center">
<div class="col-lg-12 col-md-12 text-center">
<span class="h5">Follow us:</span>
Link1
Link2
Link3
Link4
</div>
</div>
</div>
</section>
<footer class="footer">
<div class="container-fluid">
<div class="row text-center">
<div class="col-lg-12">© 2019 - Apollo Scientific Ltd</div>
</div>
<div class="row justify-content-center text-center">
<div class="col-lg-4">
Terms and conditions
</div>
<div class="col-lg-4">
Privacy policy
</div>
<div class="col-lg-4">
Careers
</div>
</div>
</div>
</footer>
I wanted to create 5 equal column on bootstrap for my responsive design with container-fluid. I have managed to do it. But I need one of those columns to disappear on lower resolutions. (Which I have already did as well) So on the mobile view I want to separate those 4 columns into two rows equally. However, my current code is failing to do it so. It gets separated into 2 rows but on the first row there are 3 equal column and on the second row there is only one column which is equal to those 3.
This is my current Bootstrap code;
<div class="container-fluid content">
<div class="row">
<div class="col col-xs-6">
<div class="stats">
<div class="big">111</div>
<div class="small">COLUMN 1</div>
</div>
</div>
<div class="col col-xs-6">
<div class="stats">
<div class="big">222</div>
<div class="small">COLUMN 2</div>
</div>
</div>
<div class="col d-none d-md-block">
<div class="stats">
<div class="big">333</div>
<div class="small">COLUMN 3 (DISAPPEARS ON LOW RES)</div>
</div>
</div>
<div class="col col-xs-6">
<div class="stats">
<div class="big">444</div>
<div class="small">COLUMN 4</div>
</div>
</div>
<div class="col col-xs-6">
<div class="stats">
<div class="big">555</div>
<div class="small">COLUMN 5</div>
</div>
</div>
</div>
</div>
What am I missing? Thanks.
col-xs-*- no longer exists in Bootstrap 4 beta. Use col-sm for equal width columns on sm and up, and col-6 for 50% width columns on mobile (xs)
https://www.codeply.com/go/W46IKaZhdR
<div class="container-fluid content">
<div class="row">
<div class="col-sm col-6">
<div class="stats">
<div class="big">111</div>
<div class="small">COLUMN 1</div>
</div>
</div>
<div class="col-sm col-6">
<div class="stats">
<div class="big">222</div>
<div class="small">COLUMN 2</div>
</div>
</div>
<div class="col d-none d-md-block">
<div class="stats">
<div class="big">333</div>
<div class="small">COLUMN 3 (DISAPPEARS ON LOW RES)</div>
</div>
</div>
<div class="col-sm col-6">
<div class="stats">
<div class="big">444</div>
<div class="small">COLUMN 4</div>
</div>
</div>
<div class="col-sm col-6">
<div class="stats">
<div class="big">555</div>
<div class="small">COLUMN 5</div>
</div>
</div>
</div>
</div>