What is the class for min width using Bootstrap 5? - bootstrap-5

I looked at the documentation for Bootstrap 5 but I can't seem to find the min-width class using pixels? Is there any?
https://v5.getbootstrap.com/docs/5.0/utilities/sizing/

Bootstrap CSS Grid layout does the heavy lifting in terms of setting responsive breakpoints.
Each view/page/front-end element can be divided into 12 parts. and you can choose how much space a container takes out of 12 vertical columns.
Bootstrap 5 gives you 6 breakpoints pre-defined, with the following syntax
col-xs-{number-between-1-to-12} width <= 540px
col-sm-{number-between-1-to-12} max-width = 540px
col-md-{number-between-1-to-12} max-width = 720px
col-lg-{number-between-1-to-12} max-width = 960px
col-xl-{number-between-1-to-12} max-width = 1140px
col-xxl-{number-between-1-to-12} width <= 1400px
Example 1: You get a parent div with 2 child divs, these children will take equal divided space inside for all screen sizes
<div id="i-am-a-parent-div">
<div class="col-6"> This takes First Half the Space inside parent element</div>
<div class="col-6"> This takes Second Half the Space inside parent element</div>
</div>
Example 2: The Children divs will share 6/12 space each till max-width=540, but then they will change space occupation to 4/12 and 8/12 respectively.
NOTE: I've added two separated classes for each child div, you can add as many as needed for each breakpoint.
<div>
<div class="col-sm-6 col-md-4"> This takes First Half (6/12) the Space inside parent element till max-width = 540px,
BUT it will only take One-Thirds (4/12) the space between 540px & 768px </div>
<div class="col-sm-6 col-md-8"> This takes Second Half (6/12) the Space inside parent element till max-width = 540px,
BUT it will only take Two-Thirds (8/12) the space between 540px & 768px </div>
</div>
If this doesnt satisfy what you need to do, Then there are more customization options to their breakpoints, Feel free to checkout: https://v5.getbootstrap.com/docs/5.0/layout/grid/#grid-options
Let me know if this helps you out!

Related

is vertical alignment with images in bootstrap 5 handled differently to text, buttons or other components?

I've run into some issues with vertical alignment for an image (using bootstrap 5).
In the index.html I've created a number of thick strips that alternate being colour and then white, with each about 800 px each. I've set the height of each strip in css to 800px.
I'm trying to place an image in each strip and the image sizes will differ in width but none will be greater than 800 px in height. The image doesn't seem to be vertically centred when I used the suggestions from the post below:
Bootstrap Center Vertical and Horizontal Alignment
There is this example given https://www.codeply.com/p/0VM5MJ7Had
And the div tag used to center everything is
<div class="d-flex flex-column min-vh-100 justify-content-center align-items-center">
In the tag above if the min-vh-100 is removed then the content just moves up to the top of the screen even though it's still justify-content-center and align-items-center.
I'm still struggling to get my head around how vertical alignment works and the relationship between containers and rows to aligning an image vertically.
<!-- color background -->
<div id="first_strip" >
<img src="../images/" class="img-fluid" alt="" />
</div>
<!-- white background -->
<div id="second_strip">
<img src="../images/" class="img-fluid" alt="" />
</div>
<!-- color background -->
<div id="third_strip" >
<img src="../images/" class="img-fluid" alt="" />
</div>
etc.

How to center the mat-chips in a stacked mat-chip-list

This is how the chips are stacked right now:
The space on the left is clearly less then on the right. How can i center the chips so that the margins on both sides are even? I've tried using custom css classes with text-align: center and vertical-align:middle but none of that worked.
EDIT: For reference here is the code:
<mat-form-field class = "chiplist" *ngIf="advancedFilterList.length > 0">
<mat-chip-list class="mat-chip-list-stacked" aria-orientation="vertical">
<mat-chip *ngFor="let advancedFilter of advancedFilterList" [selectable]="selectable"
[removable]="removable" (removed)="remove(advancedFilter)" (click)="changeUnitSymbolAndPopulateFieldsWithSelectedFilterData(advancedFilter)">
<mat-icon matChipRemove>cancel</mat-icon>
<div [innerHTML]="getFullFilterDescription(advancedFilter)"></div>
</mat-chip>
</mat-chip-list>
</mat-form-field>
You should delete the class "mat-chip-list-stacked", since it has a width of 100%, so you would already see the mat-chip centered. If you want to add CSS, create your own class and add the corresponding styles
Example: mat-chip center

Angular Material vertical percentage space

How can I make one div to take certain percent of parent space verically?See the code below:
<div layout="column">
<div id="div1" flex="70%"></div>
<div id="div2" flex="30%"></div>
</div>
I want to make div1 70% height and div2 30% height of parent div. But it does not work. Div 1 and div 2 collapsed. But if the parent layout is row, it works fine---div1 takes 70% percent space horizontally.
I think you need to make the following modifications:
Specify a "height" to your outside div. This could be a percentage or pixels.
Do not use the % sign with the flex attribute
See this codepen: http://codepen.io/sebastiengiroux/pen/jPovxG
<div layout="column" style="height: 100%;">
<div id="div1" flex="70" style="background-color:red;"></div>
<div id="div2" flex="30" style="background-color:blue;"></div>
</div>
If you look into Layout docs https://material.angularjs.org/latest/layout/introduction
there is this statement that I think is relevant to your problem.
The flex attribute value is restricted to 33, 66, and multiples of five.
For example: flex="5", flex="20", flex="33", flex="50", flex="66", flex="75", ....
So I guess if you use allowed values, you can achieve results that you need. For example using 66 and 33.

How to align a script after a div size for every resolution?

So i have this div containing a contact script:
<div id="contactbox" style="">
<form enctype="multipart/form-data" method="post" action="http://www.response-o-
matic.com/mail.php" accept-charset="UTF-8">here's the script</form>
</div>
</div>
I'm wondering if there is any way to align a script after the wrapper size for every resolution.Because i set the position of the script in percentage and on my resolution it looks centered in wrapper.But on a bigger resolution for example it's not working,it's a little bit in left side,that means the script goes after the html size because it focuses after it and it goes in the middle.
I know that if i set the wrapper with:
.wrapper
{
text-align:center;
}
then every texts from the wrapper will be centered after his size,but with scripts isnt working.So is there any way?

align portion of label to right

I have a label that needs to have a portion of it aligned to the right.
For example if this is the text box:
|left.........right|
If there is no easy way to align right... I have an idea, but I'm not sure it's possible but here it is:
I could calculate the width of the right string by adding the width of the pixels of each character, a fixed width font is ideal. With this I could calculate amount of spaces I need to insert to get the text all the way to the right.
<div style="width:200px">
Left
<div style="float:right;">Right</div>
</div>

Resources