Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

DIV and zIndex

2:30 pm on Oct 28, 2008 (gmt 0)

New User

10+ Year Member

joined:Oct 28, 2008
votes: 0

Im trying to show a text box above a div in a simple webpage.
Im viewing in IE 7 and Chrome and the text box is always below the div, although I have set the zIndex fairly high.
I have included my code.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<title>Untitled Page</title>
<style type="text/css">
width: 244px;
<div id="myMainDiv" style="BORDER-RIGHT: 1px; BORDER-TOP: 1px; BORDER-LEFT: 1px; WIDTH: 800px; BORDER-BOTTOM: 1px; POSITION: relative; HEIGHT: 600px; BACKGROUND-COLOR: buttonface;" >
<div id="myChildDiv" style="DISPLAY: inline; FONT-SIZE: 8pt; LEFT: 74px; WIDTH: 320px; COLOR: windowtext; FONT-FAMILY: Arial; POSITION: absolute; TOP: 12px; HEIGHT: 212px; BACKGROUND-COLOR: #c0ffff" tag=""></div>
<input id="Text1" style="z-index: 1000" type="text" />

5:44 pm on Oct 28, 2008 (gmt 0)

Preferred Member

10+ Year Member

joined:July 5, 2005
votes: 0

I think you need to specify the position attribute;

<input id="Text1" style="z-index: 1000; position:relative;" type="text" />


Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members