I have a problem that scares me in my sleep, inexorably. If you have an acceptable solution and you can share it, do it; I would like to sleep again.
In my last project there are several times when I will need to have 4 or 5 elements located next to each other. Each element must be sized using percentages (%), but must also have border-right: 1px solid #000 .
Once I used to compose each element with percentages, and then create a child element that would have all the style properties that the parent probably should have, including border-right . However, this solution is not ideal because it involves a lot of unnecessary markup.
Then a colleague directed me to another solution. When an element has a width that is equal to% s and must also have border-right: 1px solid #000 , apply margin-right: -1px as the offset. And although it works, it created another problem for me (which is why we are here, together, in alliance).
When scaling in any of the main browsers (ctrl mousescroll, ctrl -), floating elements that were the subject of discussion usually dance a little; the last item switches between paging on the next line and then clicking back. See image below:

The reason this issue should be resolved is because the project volume has the potential to serve people from different demographic groups (especially those who may need to scroll or go out of this position to make the text bigger or smaller), Very wide project, really.
How can I achieve my goal highlighted in the example above? How can I place 4 or 5 or more (or less) border elements located next to each other, proportionally using% s, without splitting them?
css
Vin burgh
source share