Previous page Next page

Fixed-Width Objects

One of a Web browser’s primary functions is to present text wrapped at the browser window’s right border. When dealing with internationalization, text would wrap at the left border. The browser always attempts to avoid adding a horizontal scrollbar. However, if you use fixed-width objects, like tables and pre-formatted (<pre> tag) text, wrapping becomes secondary to presenting the data exactly as HTML dictates.

Web browsers do not resize themselves larger when you add scrollbars. Thus, if there are more lines of text than can fit in the browser window’s height, a vertical scrollbar is added. This now takes up some of the width of the browser, and less text displays on a single line. If text is wider than the browser’s width, a horizontal scrollbar is added. This now takes up some of the browser’s height, and fewer lines of text are displayed.

Given the small size of the browser, it is highly desirable to avoid causing scrollbars to appear. Unless the amount of text shown in a page is kept to a bare minimum, avoiding a vertical scrollbar is unlikely. However, avoiding fixed-width objects, or ensuring that the size of fixed-width is kept small, gains some viewable space. If scrolling is a requirement, vertical scrolling is usually better perceived by users than horizontal scrolling.


Previous page Next page