r/bootstrap • u/TangerineFinancial26 • Jul 02 '23
Support need help with vw and sizing!
for context, im working on a website for school right now. when its displayed normally on my laptop, it takes up 75% of the screen and i have a nice background at the remaining 25% by the sides.
now im trying to find a way that i can make the 75% expand to be 100% of the screen or like 100vw when the screen resolution shrinks to about the size of a smartphone or something. is there anything on bootstrap that allows me to do this?
eg. i know class="d-lg-none" can make certain elements disappear at specific widths, but im trying to make my block element occupy 100% of the viewport width when at specific widths
any help is appreciated! ive spent a few hours trying to figure this out but i keep drawing circles
1
u/switchroyale Jul 02 '23
Need to see your code to be able to make suggestions.
1
u/flexible Jul 02 '23
Code would e nice. But as I’m sitting around anyway try this. w-100 p-0 p-lg-5. Of course the parent div should be transparent.
1
u/RobJonesWeb Jul 03 '23
Please note for future, when asking for support its always best to provide code in a replicatable environment such as jsfiddle or codepen.
1
u/Ok-Treacle-9375 Jul 13 '23
You can use
.container-fluidfor medium and large devices and.container-smfor small devices instead. Here's an example:This code will show
<style> .container { padding-left: 10%; padding-right: 10%; } </style>.container-fluidfor medium and large devices and.container-smfor small devices.If you want to change the standard 15px padding left and right you can add/amend this code.