I've Just Returned From The Salt, Salt Sea
I've Just Returned From The Salt, Salt Sea
I'm going back to CSS for a bit. I've made the decision. My head is so full of JavaScript atm. I need to take a break from it for a bit - and also thanks to one of the amazing EM's at work I have a new approach.
I'm not going to be trying to memorise everything from CSS anymore.
Because, the main thing with every feature and function of CSS is to know that it exists, right? I can always look it up.
Thank you. 💚👽💚👽
Wrapping Up The Box Model
I finally went back to my CSS Box Model and I finished wrapping up the task where you just play around with the example for a little bit. I finally did this after I put this up for months.
What I enjoyed: switching up the colours. What I wasn't as fussed about: changing things like margins and padding sizes. What can I say, though?
I just really like bright colours. 😍😍😍😍
Changing the Box Model
- The box dimensions
- The borders
- The padding
- The margin
Why Change The Box Model?
The box model can make it difficult to accurately size boxes. This is because the border thickness and padding (and anything else that is added on at all) are added to the overall dimensions of the box.
Box Model: Content-Box
Box Model: Border-Box
Entering in the below code resets the box model and specified a new one: border-box.
box-sizing: border-box;
}
This resets the box model to border-box for all of the HTML elements within the codebase. This new box model "avoids some of the dimensional issues" that the original box model causes.
An interesting thing in the example of the code that I have looked at is that the border thickness and padding go entirely inside of the box, thereby not extending the full size of the box at all.
Therefore, then, in the example given above, and in the border-box take on the box model, the width of the property is the same as the actual rendered width of the element. The content area is automatically sized based on the remaining width, after border and padding has been subtracted.
And so that's all that it really is, really
The difference between content-box and border-box is...
Getting Something Wrong On The Quiz
- Horizontal margins add, vertical margins collapse.
- Horizontal margins add, vertical margins collapse.
- Horizontal margins add, vertical margins collapse.
- Horizontal margins add, vertical margins collapse.
The House Carpenter
Album artwork for Myrkur, Folkesange |
Comments
Post a Comment