100% and wider?

E

Edwin Knoppert

I have a textbox and have set it's width to 100%.
The textbox resides in a usercontrol but in this case i want to force the
size of the textbox let's say 500px or 100%
So if it can't fill the pagewidth (100%) a minimal size of 500px must be
enforced.

I know it can cluther the page, that is not important for that moment.
 
K

Kevin Spencer

You can set 2 CSS styles for the textbox: min-width and width. Example:

<form method="post" action="">
<div style="width: 600px; overflow: scroll">
<input name="Text1" type="text" style="width: 100%; min-width:500px;"
/></div>
</form>

If you set the width of the div to less than 500 px, it will have a scroll
bar, and the text box inside it will be 500 px wide.

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Shooter
http://unclechutney.blogspot.com

A man, a plan, a canal, a palindrome that has.. oh, never mind.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top