Test your technical skills online, appear in Virtual Interview and be ready for job!
Twitter Twitter LinkedIn YouTube Google
Be Interview ready ! | Search
Make friends on DotNetFunda.com and expand your network!

Win Prizes

Like us on Facebook
Top Codes Author
Fri, 18-Apr-2014 Authors
All Time Authors

Latest members | More ...

(Statistics delayed by 5 minutes)

How to bring a particular HTML element on top of all other element?

Posted by Poster under CSS 3 on 2/20/2009 11:16:45 AM | Views : 22445 | Status : [Member]

By specifying the z-index style attribute of the html element we can bring it to the front of all other html element on the page. The more z-index value, the more weightage is given to the element while displaying it in the browser.

Lets say, you have two html <div> element on the page almost on the same place one after another and have different z-index value.

<div id="div1" style="position: absolute;z-index:1000;">My data</div>

<div id="div2" style="position: absolute;z-index:900;">My data</div>

In the above code, even if the 2nd div (div2) has been placed after 1st div (div1), the first div will appear on the top of the 2nd div because the z-index value of first div (div1) is more than second div (div2).

Found interesting? Add this to:

Comments or Responses

Login to post response.

Comments / Responses
Select text & click toolbar to format. Formatting appears in viewmode only. HTML Tags are not allowed.
Bold Italic Underline Paragraph Title Code  Link 
 Wait ... Processing ..... please wait.