Answered by:
textbox width constrained VS2017 default web side

Question
-
User348142989 posted
Hi
I have created the default web site from the menu of VS2017 using file - new - web site.
On the default.aspx web page, I want to place a text box that will span 100% of the web page. But, the best width I can get is about 25% of the web page in a browser. I have removed all the code provided within the content tag and have only a textbox. Here is the code. This is the only change from the default web site.
<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">
<asp:TextBox ID="TextBox3" runat="server"
width="100%">
</asp:TextBox>
</asp:Content>
Any suggestions? Thanks for any help.
Friday, December 8, 2017 12:46 PM
Answers
-
User61956409 posted
Hi TiredOldCat,<o:p></o:p>
<o:p>
I want to place a text box that will span 100% of the web page. But, the best width I can get is about 25% of the web page in a browser.</o:p>You define the width of textbox in percent, you should be aware that the percentage is based on the element's parent, please use F12 developer tools Dom Explorer to select and check the width of it’s parent element.<o:p></o:p>
I do a test on my side, which works for me. <o:p></o:p>
With Regards, <o:p></o:p>
Fei Han<o:p></o:p>
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Monday, December 11, 2017 8:00 AM
All replies
-
User61956409 posted
Hi TiredOldCat,<o:p></o:p>
<o:p>
I want to place a text box that will span 100% of the web page. But, the best width I can get is about 25% of the web page in a browser.</o:p>You define the width of textbox in percent, you should be aware that the percentage is based on the element's parent, please use F12 developer tools Dom Explorer to select and check the width of it’s parent element.<o:p></o:p>
I do a test on my side, which works for me. <o:p></o:p>
With Regards, <o:p></o:p>
Fei Han<o:p></o:p>
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Monday, December 11, 2017 8:00 AM -
User348142989 posted
Hi Fei
Thanks very much for the help. I have not yet used F12 DOM tools and you have now expanded my tool set so I am on a learning curve again.
Also, using style=width:100% works rather than the older width=100% for a text box is much better.
Have a nice day.
Friday, December 15, 2017 12:32 PM -
User811225554 posted
hi fei
hank you so moch. i had a problem with this. your advise was so helpful.
please visit my site : wikiooz
Tuesday, December 19, 2017 9:11 AM