Try changing absolute to fixed
Main Topics
Browse All TopicsI have written following code in aspx file:
html>
<body>
<form runat= "server">
<div style="height: 237px; z-index: 1; left: 10px; top: 13px; position: absolute; width: 751px;">
<asp:TextBox ID="TextBox5" runat="server"
style="z-index: 1; left: 0px; top: 40px; position: absolute; height: 22px; margin-top: 0px; right: 624px;"></asp:TextBox>
<asp:TextBox ID="TextBox4" runat="server"
style="z-index: 1; left: 130px; top: 40px; position: absolute; right: 493px"></asp:TextBox>
<asp:TextBox ID="TextBox3" runat="server"
style="z-index: 1; top: 40px; position: absolute; left: 260px; height: 22px"></asp:TextBox>
<asp:TextBox ID="TextBox2" runat="server"
style="z-index: 1; left: 390px; top: 39px; position: absolute; width: 128px;"></asp:TextBox>
<asp:TextBox ID="TextBox1" runat="server"
style="z-index: 1; left: 520px; top: 39px; position: absolute"></asp:TextBox>
</div>
<asp:Button ID="Button1" runat="server"
style="z-index: 1; left: 14px; top: 212px; position: absolute" Text="Button" />
</form>
</body>
</html>
I have 5 text box controls and their width is 128 and the distance between them is 2 pixels so difference between each of them;s left would be 130(128+2). I have made it sure that it is uniform but when I run the layout then the text box are over lapping in the browser.
I am not sure what can be problem
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
To be honest I've never ever been a fan of absolute positioning. I ran into all sorts of problems when rendering in browsers, different browsers (even different versions) can render it quite a bit different. Use the positioning stuff that will allow you to place your controls in the flow of the page. That way you know where it'll appear, instead of ignoring all other items on the page and possibly being put ontop of other things.
But it's just my opinion, maybe there is some trick that I missed. But I found it to be a complete pain.
Pretty much. A combination between HTML and CSS (Like somebody mentioned earlier, if you don't want to use tables to help with your layout, there are CSS properties like float, etc).
You can also set the properties of such things as div's, or tables, or drag tables to the design page and manipulate the same HTML there (by going to the properties of such control) if you're using visual studio.
Yeah, there is really a big arguement to both sides of Divs/CSS vs Tables. But I don't think that's the point of this authors post. Really if he wants 5 text boxes side by side, he doesn't even have to use float: left.... just put them all next to each other with an between them..... but if he wanted each in it's own div that's when it'd become handy.
Either way. I think he got his question answered....
Business Accounts
Answer for Membership
by: arhamePosted on 2009-10-09 at 13:24:27ID: 25538532
The problem is you're using absolute positioning....