Welcome to WebmasterWorld Guest from 54.162.224.176

Forum Moderators: incrediBILL

Message Too Old, No Replies

DIV and zIndex

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

New User

5+ Year Member

joined:Oct 28, 2008
posts:1
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" >
<head>
<title>Untitled Page</title>
<style type="text/css">
#Text1
{
width: 244px;
}
</style>
</head>
<body>
<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" />
</div>
</body>
</html>

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

Preferred Member

10+ Year Member

joined:July 5, 2005
posts:352
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