I’m not saying that I’m lazy to do math, but is there a better way to perform this task:
I have a page that with width: 960px, inside it has 2 divs that are width: 50%. That’s quite simple, but if I want to add 1px border I have to calculate 960/0.5 minus the extra pixels of the borders, they should be 4px but strangely they are counted as 2px (left and right side of 2 divs right?). Also, when I add margin and padding I have to calculate everything again. Lets say I add 10px margin, I have to convert the % to px and sometimes it gives me annoying numbers like 760.25px. I would like to know if you are using a better approach or if its unnecessary to do it like this. Thanks.
I’m not saying that I’m lazy to do math, but is there a better
Share
You can add more elements for sizing:
You can use percentages for element with no margin, border or padding, and you can use margin, border and padding on the elements inside that has auto width.