Brainfreeze... textarea 100% width

Discussion in 'CSS' started by Triexa, Apr 23, 2007.

  1. #1
    Say I have a container that has 75% width...

    How do I have my textarea take up the full width, including a padding of 2px and 1px border?

    If I just do style="width:100%" ... it will take up 100% plus 6 extra pixels...?
     
    Triexa, Apr 23, 2007 IP
  2. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #2
    What do you mean? The form control, <textarea>? Or do you mean a block element that can contain text? If the latter, just don't set a width. A block element takes all the available width, with allowances for padding, borders and margins.

    cheers,

    gary
     
    kk5st, Apr 23, 2007 IP
  3. Mr Blonde

    Mr Blonde Guest

    Messages:
    142
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #3
    if you are talking about the form control, you could always just set it at 98 or 99% and the padding and borders should fit into there nearly making 100%. I know its not spot on but should be fine.

    another way is to add a negative right or left margin for however much extra you need, but in ie6 it just cuts the negative margin out of view unlike modern browsers.
     
    Mr Blonde, Apr 23, 2007 IP
  4. Triexa

    Triexa Active Member

    Messages:
    580
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #4
    Ya I mean the form control... but hmm.. wish there were an alternative to the 98% or something... :)
     
    Triexa, Apr 24, 2007 IP