box-sizing: border-box

What does box-sizing: border-box actually do? how is it different from the default box-sizing? And I noticed that when it is default box-sizing, any element with width: 100vw doesnt stretch full, that is it leaves some space at the left side, why is it so?
No description
4 Replies
b1mind
b1mind4w ago
Basically you're telling CSS to include to the* border in calculated size. I would learn about the box model, makes this super clear Far as your actual issue I would avoid using 100vw on things unless you know you need to
b1mind
b1mind4w ago
Kevin Powell
YouTube
The problems with viewport units
Conquering Responsive Layouts (free course): https://courses.kevinpowell.co/conquering-responsive-layouts Join the Discord: https://kevinpowell.co/discord Viewport units often feel like this cheat code that makes things so much easier when you first discover them, but they actually are problematic for a number of reasons, from creating horizon...
b1mind
b1mind4w ago
Kevin Powell
YouTube
box-sizing: border-box explained
You probably see box-sizing: border-box used all over the place. I use it in my tutorials, it's used in most written and video content I see. In this video, I take a look at what border-box is, and why it's really awesome. CSS-Tricks article I mentioned in the video: https://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-p...
nnnakuuul
nnnakuuul4w ago
ohh okk thanks
Want results from more Discord servers?
Add your server
More Posts
How to store redux store to localstorage and get it when page refreshedThe issue where the page refresh causes an automatic logout typically occurs because the token is noEmmet Autocomplete for srcset atrributeSteps to reproduce: Position your cursor inside the " " for srcset & type a /. You cannot use autocoRelative color from currentcolorHello everyone, On MDN's relative color page (https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Background image is not full height with dialog elementHello, without using `background-attachment: fixed`, I would like the image on this page (https://wigrid container with flexible rows?i'm not sure if this is the right title but here we go. so i wanted to have a grid container with 3 WebSocket Chat Application in Spring Boot Not Receiving Messages in PostmanProblem Description: I'm working on a WebSocket chat application using Spring Boot. The application Promises questionI have the following code: ```js function geocode(location) { geocoder = new google.maps.GeocoderReal-time Chat Messages Not Appearing in Angular & Spring Boot ApplicationHello everyone, I'm working on a chat application using Angular on the frontend and Spring Boot on please help me wrap my head around flex-basis (particularly flex-basis:0)Ok so i understand flex-basis sets an initial starting point width for a flex item. In the case of fMatch width sizing on flex containers?I was wondering if anybody knew a neat way to grab the width of a flex-item container and apply it t