Приглашаем посетить
Бианки (bianki.lit-info.ru)

Q&A

Previous Page
Table of Contents
Next Page

Q&A

Q1:

How do you know when to use relative versus absolute positioning?

A1:

Although there are no set guidelines regarding the usage of relative versus absolute positioning, the general idea is that absolute positioning is required only when you want to exert a fine degree of control over how content is positioned. This has to do with the fact that absolute positioning allows you to position content down to the exact pixel, whereas relative positioning is much less predictable in terms of how it positions content. This isn't to say that relative positioning can't do a good job of positioning elements on a page; it just means that absolute positioning is more exact. Of course, this also makes absolute positioning potentially more susceptible to changes in screen size, which you can't really control.

Q2:

If you don't specify the z-index of two elements that overlap each other, how do you know which element will appear on top?

A2:

If the z-index property isn't set for overlapping elements, the element appearing later in the web page will appear on top. The easy way to remember this is to think of a web browser drawing each element on a page as it reads it from the HTML document; elements read later in the document are drawn on top of those read earlier.


Previous Page
Table of Contents
Next Page