Interview Questions

Why aren't my frames the exact size I specified?

HTML Interview Questions and Answers


(Continued from previous question...)

55. Why aren't my frames the exact size I specified?

Older versions of Netscape Navigator seems to convert pixel-based frame dimensions to whole percentages, and to use those percentage-based dimensions when laying out the frames. Thus, frames with pixel-based dimensions will be rendered with a slightly different size than that specified in the frameset document. The rounding error will vary depending on the exact size of the browser window.
Furthermore, Navigator seems to store the percentage-based dimensions internally, rather than the original pixel-based dimensions. Thus, when a window is resized, the frames are redrawn based on the new window size and the old percentage-based dimensions.
There is no way to prevent this behavior. To accomodate it, you should design your site to adapt to variations in the frame dimensions. This is another situation where it is a good idea to accomodate variations in the browser's presentation.

(Continued on next question...)

Other Interview Questions