100% and wider?

Discussion in 'ASP .Net' started by Edwin Knoppert, Oct 17, 2006.

  1. 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.
     
    Edwin Knoppert, Oct 17, 2006
    #1
    1. Advertising

  2. 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.

    "Edwin Knoppert" <> wrote in message
    news:45349f74$0$2029$...
    >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.
    >
    >
     
    Kevin Spencer, Oct 17, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. TS
    Replies:
    2
    Views:
    7,117
  2. Don Wash
    Replies:
    3
    Views:
    10,980
    Don Wash
    Aug 7, 2004
  3. Guest
    Replies:
    5
    Views:
    383
    Guest
    Mar 15, 2005
  4. fred
    Replies:
    3
    Views:
    306
    Zifud
    Mar 17, 2005
  5. Replies:
    5
    Views:
    921
Loading...

Share This Page