JQuery equally spaced navigation links inside unordered list problem
问题 I'm writing a JQuery script which evenly spaces variable-sized horizontal navigation links inside a containing <ul> , using margin-right. The algorithm is: A: Get width of <ul> container. B: Add up widths of all <li> items inside container. C: Calculate right margin for each item except the last <li> by subtracting B from A and dividing by the number of <li> items in the container, minus 1. But there is a flaw either in my algorithm or in my code, because the links are overflowing the