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
Solved

Infinite z-index - Element always on top

Posted on 2008-06-25
5
1,429 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
  • 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This article discusses how to create an extensible mechanism for linked drop downs.
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…

828 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