![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||||
| |||||
|
|
I am basically trying to accomplish drop down menus for navigation on a site. And I'm pretty much done except I am having one problem. The z-index is not working with relative positioning! div.sublinksdiv { z-index:+1; |
| http://members.rogers.com/asadkhan2/prob1.jpg As you can see, when a mouse rolls over the main links, the sublinks do appear at appropriate location; however it pushes down the content! |
|
Now this just looks ridiculous how the content moves around. Basically the z-index property isn't functioning. |
|
Interestingly enough "position: absolute" makes z-index work perfectly! |
|
However, then the position gets all messed up with different sized windows as I am centering everything. (There is no fixed left position for the submenu to appear: its RELATIVE). |
#3
| |||
| |||
|
|
asadikhan (AT) hotmail (DOT) com (Asad) wrote: I am basically trying to accomplish drop down menus for navigation on a site. And I'm pretty much done except I am having one problem. The z-index is not working with relative positioning! div.sublinksdiv { z-index:+1; What nakes you think that +1 is a valid value for z-index? http://www.w3.org/TR/CSS2/visuren.html#propdef-z-index |
#4
| |||
| |||
|
|
On Fri, 09 Jul 2004 17:04:14 +0100, Steve Pugh <steve (AT) pugh (DOT) net> wrote: asadikhan (AT) hotmail (DOT) com (Asad) wrote: z-index:+1; What makes you think that +1 is a valid value for z-index? http://www.w3.org/TR/CSS2/visuren.html#propdef-z-index z-index accepts the value <integer>, and the definition at http://www.w3.org/TR/CSS2/syndata.ht...ue-def-integer says: "Some value types may have integer values (denoted by <integer>) ... An integer> consists of one or more digits "0" to "9" ... Both integers and real numbers may be preceded by a "-" or "+" to indicate the sign. Note that many properties that allow an integer or real number as a value actually restrict the value to some range, often to a non-negative value." There's nothing explicit there at http://www.w3.org/TR/CSS2/visuren.html#propdef-z-index which suggests that using + or - would be incorrect for this property. Unless I'm missing something. |
#5
| |||
| |||
|
|
So make a centered parent element with position: relative; and then put the position: absolute; inside that so that it's positioned relative (confusing...) to the parent div and not the page as a whole. Steve |
#6
| |||
| |||
|
|
Steve Pugh <steve (AT) pugh (DOT) net> wrote: So make a centered parent element with position: relative; and then put the position: absolute; inside that so that it's positioned relative (confusing...) to the parent div and not the page as a whole. Ok ... what? Can you give me an example? |
|
(Kindly start another thread on possible z-index values; that is not the purpose of this thread and the subject is misleading. Thanks.) |
![]() |
| Thread Tools | |
| Display Modes | |
| |