Solved

Infinite z-index - Element always on top

Posted on 2008-06-25
5
1,431 Views
Last Modified: 2008-11-27
How can I tell an element to have an infinite z-index?

For example, if I have two divs:

<div id="top">Always on top</div>

<div id="bottom">Always on bottom</div>

How can I tell the top div to *always* have a higher z-index?

Thank you!
0
Comment
Question by:lightmatrix
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 7

Accepted Solution

by:
Brad Dobyns, CSM earned 300 total points
ID: 21870390
There is no such thing as an infinite z-index. However, z-index only works if you set the position of your div to relative or absolute.

You could do this:

#top {
position: relative;
z-index: 999;
}
0
 
LVL 7

Expert Comment

by:Brad Dobyns, CSM
ID: 21870406
Or something like this:

top.zIndex = 999;
0
 
LVL 7

Expert Comment

by:Brad Dobyns, CSM
ID: 22019028
Did this solution work? I have not heard from you.

Thanks,
Brad
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question