Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Infinite z-index - Element always on top

Posted on 2008-06-25
5
Medium Priority
?
1,440 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
3 Comments
 
LVL 7

Accepted Solution

by:
Brad Dobyns, CSM earned 1200 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

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
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…
Suggested Courses

877 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