How to use grids in modal bootstrap dialogs? - css

I'm trying to use the bootstrap-5 grid system inside a modal popup.
For testing, I simply took the main modal example from https://getbootstrap.com/docs/5.0/components/modal/, and added the grid example inside the modal-body:
<div class="modal-body">
<div class="container-fluid">
<div class="row">
<div class="col-md-4">.col-md-4</div>
<div class="col-md-4 ms-auto">.col-md-4 .ms-auto</div>
</div>
....
Result: the grid is not respected in any way. But why?
https://jsfiddle.net/3041fLwk/

The issue is bootstrap doesn't implement responsive on modal.
It relies on parent window for media queries.
The same if you create a smallbox with limited width.
To implement responsive on modal is to use iframe, or gotta set breakpoint on modal yourself

I think your problem is coming from your use of ms-auto - when I removed all of the ms-auto classes the grid worked as expected.

Related

Problem with a bootstrap grid not web responsive

I have this Bootstrap grid https://www.codeply.com/p/FuHGj3t94N
It works fine with large desktop , but on mobile all is messed up.
Especially the "NEW" text is not visible in mobile and is not responsive.
What is wrong in my Bootstrap grid code ?
Please flow the Bootstrap grid system.
And please see the code here to see your code demo
you should add
<div class="col-lg-1 col-md-1 col-sm-2 col-4"
and
<div class="col-lg-11 col-md-11 col-sm-10 col-8"
to make 100% responsive

Grid Gap Boostrap - How to fix?

I have created a grid at bootstrap but when I do not have enough cards to fill the page they get spaced vertically. I want them to be grouped with a fix gap between them.
Find image's url attached.
Just check how to work grid in browser
https://getbootstrap.com/docs/3.3/examples/grid/
and use like
<div class="container">
...
</div>
<div class="row">
...
</div>

Bootstrap 3 remove middle two breakpoints

Is it possible to remove the middle two breakpoints in Bootstrap 3 and have the browser visually "scale/shrink" the page, so in those breakpoints you don't have to scroll left or right to see the page?
Basically, I have a design that I want to be responsive, but only be responsive for the small breakpoint and the large breakpoint, but I don't want a viewer to have to scroll left or right to see all the content.
Here is an example that I'm working on that doesn't work. I've tested on the iPad and I have to scroll around left and right to see the content:
http://matthewtbrown.com/test/myprojects.html
Just checked your code via Developer Tools, you're using container-fluid for the parent container.
When using container-fluid you should use row-fluid instead of row.
We use row when using container and row-fluid when using container-fluid.
It should be something like this:
<div class="container-fluid">
<div class="row-fluid">
<div class="col-lg-4">...</div>
<div class="col-lg-4">...</div>
<div class="col-lg-4">...</div>
</div>
</div>

Using angular ui.layout in column mode - how to create a bottom aligned element

I just started to use angular ui-layout to allow splitting panes in a UI.
I'm trying to create a sidebar that has this blue element on the bottom
Is there a way to trick the ui-layout directive to achieve this? I tried doing size, but that just does absolute sizing, I want the bluebox just take up some space (showing 100% of its content) and the element above it needs to scroll and take up the rest of the vertical space.
EDIT: added the HTML
<ui-layout options="{ flow: 'row' }">
<div ui-layout-container> top part </div>
<div ui-layout-container> blue box</div>
</ui-layout>
I don't know why you want to use ui.layout, but I would not recommend to use it to achieve what you want.
ui.layout uses flex box model and you can use it by yourself without using another invasive javascript layout. You can fully achieve what you want using css only.
This is what I did to achieve what you want only using CSS. http://plnkr.co/edit/0mSxkNC5wl6WTbWc81z6?p=preview.
<div class="container flex flex-column">
<div class="top flex flex-row flex-auto flex-stretch">
<div class="flex-auto">Top</div>
<div class="sidebar">sidebar</div>
</div>
<div style="background:blue">Bottom</div>
</div>
If you are very interested in using Flex layout, I would recommend to use Angular Material Design, and it is advanced and makes more sense than ui.layout.
To know more about flex box, you can see this example.
http://plnkr.co/edit/lxx7QCwZbeZyyUtwiCym?p=preview.

Bootstrap navbar navbar-fixed-top crash down after certain size

I'm trying to implement a fixed nav bar, but after certain screen size (~width:989),
the nav bar moves down. It doesn't work on mobile either.
Image:
The navbar is completely stuck to the footer instead of staying on top of the page.
You can check the code at: http://www.lostsavings.co.il
You have a few other issues, but the major issue is that the nav-fixed-top content is at the bottom of the page right now... in other words, you have:
<div class="container"> content here </div>
<div class="navbar"></div>
<div class="footer"></div>
Move that navbar to the top of the natural document flow, as if you were using no bootstrap, jquery, etc...
<div class="navbar"></div>
<div class="container"> content here </div>
<div class="footer"></div>
You'll have to fine-tune quite a few margins, etc... and I see a few !importants that could be getting in the way, too, but I'm guessing some of that has been part of your attempt to troubleshoot this. Making the above change at least made the navbar appear at the top for me.

Resources