SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member yottalab's Avatar
    Join Date
    Jan 2010
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    textarea 's content absolute align center

    <textarea style=" text-align:center" ></textarea>
    -------------------------------------------------
    1
    2
    -------------------------------------------------
    why? if i input "1" in textarea ,then press enter key and then input "2" .
    "1" is not absolute align ceter ? how to resolve this problem ?


    think you for your attention .

    from china

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,156
    Mentioned
    190 Post(s)
    Tagged
    2 Thread(s)
    Hi, yottalab, welcome to the forums.

    AFAIK styling form inputs with CSS is notorious for inconsistent browser support. This may be one of those where the browser "does it's own thing".

    I think it would be involved, but if you must, maybe use javascript to pad the input with spaces?

  3. #3
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    The 'typed text' within a TEXTAREA 'text box' (what a mouthful) is an "input control" really. So it's quite correct it doesn't have to centre align the text though it is likely to right align due to language 'text direction'. For further clarification:

    Quote Originally Posted by http://www.w3.org/TR/CSS21/conform.html#conformance
    CSS 2.1 does not define which properties apply to form controls and frames, or how CSS can be used to style them. User agents may apply CSS properties to these elements. [...]
    The same could also apply to the TEXTAREA case.


Tags for this Thread

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
  •