Hi,
How can I position one elemenent on top of another within a table cell? I need the <TextBox> element positioned on top of the <input> element. The second element, the <TextBox>, is currently displaying below the <input> element. I tried using the left, top, display, and position style attributes with no luck. Below is the code.

Thanks,
Mike

<tr>
<td align="left" style="width:765px;">
<input id="txtArtwork" style="Z-INDEX: 149; WIDTH: 724px; HEIGHT: 22px;" tabindex="17" type="file" src="//localhost/ArtworkAttachments" size="101" name="MyFile" runat="Server">
<asp:TextBox id="txtSelectedFile" style="Z-INDEX: 149;" runat="server" Width="642px" tabIndex="18"></asp:TextBox>
</td>
</tr>

Try something like this:

<style>
    		.wrapper {
    			position:relative;
    		}
			
			#txtSelectedFile {
				position:absolute;
				top:0;
				left:0;
				z-index:150;
			}
    	</style>
		
        <div class="wrapper">
            <input id="txtArtwork" style="Z-INDEX: 149; WIDTH: 724px; HEIGHT: 22px;" tabindex="17" type="file" src="//localhost/ArtworkAttachments" size="101" name="MyFile" runat="Server">
            <asp:TextBox id="txtSelectedFile" style="Z-INDEX: 149;" runat="server" Width="642px" tabIndex="18"></asp:TextBox>
        </div>

Should do the trick

Yes, that worked!

Thanks.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.