|
|
|
|
|
by donatj
460 days ago
|
|
> Adding a border changes the size of the items, which might not be desirable This issue has been addressed for well over a decade. Is the first line of everyone's css files not just: * { box-sizing: border-box; }
That makes borders figure on the inside of the width rather than the outside. It's far more sane to reason about. |
|
<content1> <content2> <content3>
If you start out with equally spaced columns, and then you add borders to content2 and content3 to end up with this visually:
<content1> <border> <content2> <border> <content3>
The DOM actually looks like this:
<content1> <border content2> <border content3>
Now content2 and content3 are smaller than content1, because the borders are part of their width. Borders are the wrong tool for this job no matter the value of box-sizing.