Hello. Before me is such a task: There are 3 menu buttons in the navbar. I want to distribute them evenly across the width of the screen (parent unit), but they (li elements themselves) must also be stretched across the width so as to occupy all the space. As if I set them width: 33.33%, only that the width depends on the filling. Is it possible to register some kind of logic (maybe using js) of the type width1_new = width1 / (width1 + width2 + width3) * 100%? Other solutions to my problem are also welcome, since I still wanted to achieve such a result without javascript. Maybe you can put some padding on li?
ul { padding: 0; margin: 0; display: flex; flex-direction: row; justify-content: space-around; } li { list-style-type: none; display: inline-block; border: 1px solid black; background-color: gray; /*width: 33%;*/ } <ul> <li> <a href="#">PROFESSIONS</a> </li> <li> <a href="#">KNOWLEAGE BASE</a> </li> <li> <a href="#">PEOPLE</a> </li> </ul>