Hello Good Evening, how to vary the width of a div depending on the device:
use : w-lg-80 w-md-60 w-sm-100 but it doesn't work.
For example:
<div class="container w-lg-60">
<div class="row" style="background-color:#C2F8F7">
<div class="col-sm-12 col-md-12 col-lg-12" style="border:1px solid">
<div class="d-flex justify-content-center">
<b>Registro de Clientes</b>
</div>
<div class="d-flex justify-content-center">
<img src="img/registro_cliente.png">
</div>
To vary depending on the device you would have to create the columns with
.col-sm/md/lg/xl
since the.w-25/50/75/100
only thing they do is define that the element will have a width of 25% / 50% / 75% / 100% on any type of device ..col-
This class is for devices that have a screen that is less than 576px wide..col-sm
This is for devices with screens 576 or more px wide.col-md
This is for devices with screens that are 768 or more px wide..col-lg
works for devices with screens that are 992 or more px wide.col-xl
works for devices with screens 1200 px or more wideBootstrap's grid system can be divided into 12 columns per line (
.row
).An example of how it works:
As you can see, each
.row
contains internal columns that add up to a value of 12. In this case, I always used the same "measures" to show you how it works, but it could also work like this:To see the difference use the 'full screen' button and play with the size of the browser
As you can see, the sum of the columns is always 12 .
I hope it helps you to understand what you should do to solve your problem.
PS: the columns do not always have to have the same value for each device, that is, you could also do something like this:
<div class='col-sm-3 col-lg-6'> </div>
with this, the size of the element changes based on the devicesuccesses.
Friend, use media queries depending on the size of the device, assign the damage you want to the divs, it is the best option and fully responsive.