align a textarea box to the right of the page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kgreen
    New Member
    • Oct 2006
    • 1

    align a textarea box to the right of the page

    I don't know how to right align a textarea box. I can use the center tag and the textarea box centers, but when I use the align=right attribute, the table stays at the left. How do I right align a textarea box?
  • kestrel
    Recognized Expert Top Contributor
    • Jul 2006
    • 1071

    #2
    you'd have to put the <textarea> tag into a <p> tag.

    Code:
    <p align="right"><textarea></textarea></p>
    that works perfectly


    hope this helps!

    Devin Keogh
    TheJetPage.com
    Last edited by gits; Jun 14 '19, 04:55 AM. Reason: added code tags

    Comment

    • drhowarddrfine
      Recognized Expert Expert
      • Sep 2006
      • 7434

      #3
      Since all of that was deprecated years ago it would be better to use CSS and do this:
      Code:
      <textarea style="float:right">hello</textarea>
      Last edited by gits; Jun 14 '19, 04:54 AM. Reason: added code tags

      Comment

      • kestrel
        Recognized Expert Top Contributor
        • Jul 2006
        • 1071

        #4
        yeah thats better, disregard my first post

        Comment

        • gosai jahnvi
          New Member
          • Apr 2019
          • 22

          #5
          you can try this code i hope so it will help for you:

          Code:
          <!DOCTYPE html>
          <html>
              <head>
                  <title>Right the textarea</title>
              </head>
              <body>
              <div align = "right">
              <textarea placeholder="noticeboard" cols="25" rows="15">
          
              </textarea> <br />
              </div>
              </body>
          </html>
          Last edited by gits; Apr 1 '19, 08:35 AM. Reason: removed unrelated link and added code tags

          Comment

          • gits
            Recognized Expert Moderator Expert
            • May 2007
            • 5390

            #6
            thats really an old thread and the css solution shown by drhowarddrfine above is much preferable

            Comment

            • AjayGohil
              New Member
              • Apr 2019
              • 83

              #7
              Try to this Style for align right
              Code:
              <textarea style="float: right;">Right Textarea</textarea>

              Comment

              • gits
                Recognized Expert Moderator Expert
                • May 2007
                • 5390

                #8
                yea - that solution was already provided in post #3 in 2011.

                Comment

                Working...