Search
Winners

Win Prizes

Social Presence
Twitter Twitter LinkedIn YouTube Google

Like us on Facebook
Advertisements
Top Codes Author
Fri, 31-Oct-2014 Authors
Vishal@Neeraj
240
All Time Authors
Satyapriyanayak
12160
Vishal@Neeraj
8800
Jayakumars
8120

Latest members | More ...


(Statistics delayed by 5 minutes)
 Codes

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

Poster
Posted by Poster under CSS 3 on 2/20/2009 11:16:45 AM | Views : 27915 | 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