FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

how to align text inside input type text filed box

 


afracsass
hi,

Whenever I write some words inside input type=text form filed box, it automatically aligned to the left side of the box and the next letter adds to the right.

Can I make it to align to the right and whenever I type a new letter the previous letters move to the left so that make a room for a new letter.

Code:

ex)
--------------------------------
|A <---starts from left side   |
--------------------------------

I'd like to change this to
-------------------------------
|                            A|
-------------------------------



possible? ^^*
mariohs
just put this into your css:
Code:
input{
text-align:right;
}


I made a small fragment of code for you to see it in action...

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
   <head>
      <title>Form</title>
      <style type="text/css">
         input{
         text-align:right;
         }
      </style>
   </head>
   <body>
   <form action="post.php">
      <label for="text">Text:</label>
      <input type="text" name="text" id="text" size="10" maxlength="10" />
   </form>
   </body>
</html>
afracsass
Wow! it works perfectly. Thank you so much...you're my savior ^^*
mariohs
no problem, feel free to ask for help... always glad to help people Wink
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.