COM271, Week 6

Fixed positioning

Syllabus | Table of Pages | Assignments | References and Useful Links

Fixed positioning for page elements: CSS positioning uses the position attribute and offsets top (or bottom) and left (or right). Positioning is normally done within the context of the page or of a previously positioned containing element. (See Static, relative, and absolute positioning) Position:fixed is the exception.

The column at the left is positioned using the value fixed. Its positioning context is the screen, not the page. The page may be scrolled (I have added 500 pixels padding to the bottom of the last paragraph to permit you to scroll), but the column will not move. On most monitors at most resolutions (say, 19inch, 1280 x 1024 pixels), the bottom of the column will not be visible or accessible. This will not make users happy. Restrict use of fixed positioning for page elements to those that are small enough that they could normally be expected to appear in their entirety in a small (14in) monitor.

Fixed positioning of background images: A more common and useful fixed positioning is to set a background image such that the screen may be scrolled while the image remains in place.

In general, fixed positioned backgrounds should be done reluctantly and with care. The primary consideration is to balance any gains in overall aesthetic pleasantry against possible distraction, with particular attention to concern for visual readability. That is, text over a background image should not cause the reader to suffer eye strain or to experience difficulty in reading the text. The background should be relatively plain, without sharp lines that would interfere with seeing the sharp shapes of letters. It should also provide a wide contrast in color or darkness, making it possible for visually impaired (e.g., the 7% of the population that is "color blind") to read with ease. Techniques for accomplishing this are covered elsewhere (see Syllabus, week 6, for works in progress)

W3C Schools
CSS Reference
Quick Index

CSS Basic

Selectors and Declarations CSS Introduction CSS Syntax CSS Id & Class CSS How To

CSS Styling

Styling Backgrounds Styling Text Styling Fonts Styling Links Styling Lists Styling Tables

CSS Box Model

CSS Box Model CSS Border CSS Outline CSS Margin CSS Padding

CSS Advanced

CSS Grouping/Nesting CSS Dimension CSS Display CSS Positioning CSS Floating CSS Align CSS Pseudo-class CSS Pseudo-element CSS Navigation Bar CSS Image Gallery CSS Image Opacity CSS Image Sprites CSS Media Types CSS Attribute Selectors CSS Don't CSS Summary

CSS Examples

CSS Examples

CSS Quiz

CSS Quiz CSS Certificate

CSS References

CSS Reference CSS Reference A to Z CSS Reference Aural CSS Web Safe Fonts CSS Units CSS Colors CSS Colornames CSS Colorvalues