I am trying to work with a div element
<body style="width: 100vw; height: 100vh">
<div id="containerDiv">
<div id="canvasDiv" />
</div>
</body>
My goal is to adjust the width of canvasDiv
based on the screen size. I want it to be 30% of the width of containerDiv
on larger screens, and 100% on smaller screens.
I'm hoping to achieve this using Bootstrap for simplicity. I have made some progress by including the following code:
<body style="width: 100vw; height: 100vh">
<div id="containerDiv" style="width: 100%; height: 100%">
<div id="canvasDiv" class="container-md m-md-0" />
</div>
</body>
Currently, the width of canvasDiv
changes at the Bootstrap's md
breakpoint. Is there a way to override this behavior and set it to 30% instead?
I understand that I may have multiple questions here. Any guidance or redirection to relevant resources would be greatly appreciated to help me gain a better understanding.