css border-width percentage
问题 I have one div wrapping another like so <div id="container"><div id="box"></div></div> Let's say the container has a dimension 100px by 100px. I want to box to have 0px height and 0px width. However, I want the left border of the box to fill up 50% of the container, and the right border of the box to fill up the the other 50% of the container. How do I do this with css? 回答1: You can do what you are after, but using linear-gradients instead of borders. Use the following markup: <div class="box