SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2006
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Quick Textarea Question

    Just wondering why the textarea tag requires cols="" and rows="" attributes when you can use CSS to style a width and height. Am I missing something here? I know they're required in order to validate, but I don't really get what the attributes do and why they're important.

    Thanks,
    Matt

  2. #2
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,806
    Mentioned
    157 Post(s)
    Tagged
    3 Thread(s)
    Before CSS came to the fore, that was the recognised way of controlling the height and width of a textarea. Now it's pretty well redundant..
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  3. #3
    SitePoint Enthusiast
    Join Date
    Sep 2006
    Posts
    59
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is it ok for me to leave out those attributes then? Is there any reason for me to use both? I'd rather specify a pixel value and not worry about it being effected by the cols="" and rows="" attributes.

  4. #4
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,806
    Mentioned
    157 Post(s)
    Tagged
    3 Thread(s)
    personall I go with the CSS option but if the validator is requestion the options and you want to by totally compliant leave them in as blank.
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  5. #5
    Guru Meditation Error gnarly's Avatar
    Join Date
    Dec 2003
    Location
    Cheltenham, United Kingdom
    Posts
    692
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You should specify rows/cols and a measurement in your CSS. The former specifies how big the textarea should be for non-CSS users, whereas the latter only works for CSS-enabled users.

    If you're only going to implement one or the other, go for rows/cols. In this case it isn't about presentation so much as accessibility for non-CSS users.
    Olly Hodgson
    thinkdrastic.net

  6. #6
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @gnarly: Well said!
    Birnam wood is come to Dunsinane


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •