After reading CSS Web Design For Dummies by Richard Mansfield, I was very intrested in his explanation on relativity in CSS, I have captioned some of this chapter here below. If you like what you read here below then I highly recommend that you buy this book, its a good read for anyone wanting to get started with CSS.
Relative positioning means that an element is located in terms of another element.
Relative location might mean an element is centered in the middle of the other element, or 35 pixels to its left, or 25 percent down from its top. The main point is that the first element¡¯s position depends on the other element¡¯s location. As you saw in Figure 4-3, a headline can be centered relative to the browser window.
Absolute positioning specifies a particular number (pixels, points, inches, whatever measurement system you choose) by which the element should be positioned. Absolute size is described by width and height numbers.
Absolute position is described by two numbers: the top and left. Technically called coordinates, these two numbers tell the browser exactly where to put the element within the browser¡¯s window. Top 3 inches means put the top of the element three inches down from the browser window frame. Left 2 inches means two inches over from the left side of the frame. Using these two coordinates, you can put anything, anywhere.
Some designers try to make their Web pages extremely flexible so that they can be viewed in many different sizes ¡ª from tiny PDA screens to gigantic stadium screens. This is another reason to use relative size and position techniques. Notice that when you choose View -> Text Size in Internet Explorer, you are shown relativistic options: largest, larger, medium, smaller, smallest. You don¡¯t see choices like 1 inch, 1/2 inch, 1/4 inch, and so on, which are absolute specs. The people who designed Internet Explorer assumed that
people are using different-size screens with different resolutions settings (800x600 and others). So the meaning of ¡°large¡± should be relative to the resolution, not some fixed (absolute) unit of measurement. What¡¯s largest on a PDA is quite a different size from what¡¯s largest on a Jumbotron, right?
Of course, as Albert Einstein pointed out, everything is relative except the speed of light. So, when we speak of ¡°absolute¡± positioning, it merely means that we¡¯re being somewhat ¡°less relative.¡± What do I mean by this?
You actually cannot sit still, no matter how hard you try. When you think you¡¯re sitting still, you¡¯re still moving at about a half million miles per hour as the solar system spins around the galaxy. In fact, you¡¯re moving through space in a rapid and complex corkscrew path. Even while you¡¯re quietly asleep, you¡¯re still flying aboard the rotating earth, orbiting the sun, spinning around the galaxy. And the galaxy itself is hurtling through the universe. So you¡¯re moving really fast in a dozen different circles all the time. Luckily, so is your bed and everything else in your room. They¡¯re all at rest, relative to you, but not relative to light.
The same concept applies to absolute positioning. After all, an inch on a PDA screen is quite a different thing from on a giant projection TV set. So, even though an inch is an absolute measurement, its effect is relative to the device that displays your Web page. So don¡¯t be disturbed by the somewhat slippery concept of absolute in CSS styles.
discuss this topic to forum
