Tags: size based on width pixels why can't method write article browser
Development sometimes always encounter such a problem, a line of four elements, the total width of four elements is clearly more than the total width of the parent element is smaller, but the last element inexplicably photographed the next line, how to find the reason is not found.
I found a solution, though I didn't know it was the only one, but it was an explanation.
For example, the width of four elements is 25%, the width of the parent element is 1283 pixels, then 1283 pixels 25% is 320.75 pixels, according to the browser less than 1 pixels according to 1 pixels, the width of each element is actually tried 321 pixels, so the last element will never be with other elements and shoot. The workaround is that when the parent element is a fixed pixel, the child element should also be a fixed pixel, and when the child element is set to a fixed element, the minimum width of the parent element should be set if the parent element is a percentage, so that no more inexplicable problems will occur on the style.
Speaking of a little rough, writing articles is not my strong points, can help everyone is good ~
The elements are the right size, but they don't go away. One of the explanations for margin