Reputation:
As a web developer, how do you prevent text from spilling over the edges of boxes when the browser's text size gets increased?
Upvotes: 0
Views: 479
Reputation: 48066
Most modern browsers default to zooming the entire page, nowadays, not just text - so this problem will go away as IE7+IE6 slowly die.
Upvotes: 0
Reputation: 1617
Ensure that all sizes are declared in "em" units (an "em" is the width of a single letter "m" in whichever font size is currently being used). If you specify your sizes in pixels (as is most common), then your design will not resize if the size of the font is changed.
Upvotes: 1
Reputation: 43243
There isn't much else to do that to ensure that your layout doesn't constrain height, so that the text can still fit in the box.
If you absolutely need to constrain the size, you can use overflow: auto
CSS declaration to have the box display scrollbars when the content is too large to fit.
Upvotes: 1