HI!
Could someone explain to me what this is for? Or point me to the CSS chapter so I re-read it to understand:
*,
*::before,
*::after {
box-sizing: border-box;
}
thank you!
HI!
Could someone explain to me what this is for? Or point me to the CSS chapter so I re-read it to understand:
*,
*::before,
*::after {
box-sizing: border-box;
}
thank you!
Iâve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the âpreformatted textâ tool in the editor (</>
) to add backticks around text.
See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (â).
Hey,
Iâm by no means an expert, but from my what Iâve read, that has to do with changing the box-model for the entire document. HTML default box-sizing is in content-box, which isnât as easy to work with as border-box. The content-box style doesnât include border, padding, etc. in the dimensions, but the border-box style does, so all your elements look much cleaner.
Here is a link to an article that explains it really easily and well - CSS box-sizing Property â Alligator.io
Thanks a lot for your quick response!
I understand that bit now, thanks.
Also, what about the:
*,
*::before,
*::after {
Why is it written like that?
I believe that has to do with CSS selection of elements
So when you say " * " youâre telling the computer to select all elements, but the â::before" and "::afterâ parts I think go a step further. Now youâre telling the computer to also select any elements that may come before or after (in terms of parent/children hierarchy), and for them to have the border-box style as well. This way, itâs sort of full-proof in terms of accounting for everything to have border-box vs. content-box
Ok, i think I get it now more or less. Thanks so much you!
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.