Connecting Tech Pros Worldwide Help | Site Map

proper CSS style for Textbox

Newbie
 
Join Date: Sep 2009
Posts: 14
#1: Oct 12 '09
I want to change the properties of text inside Textbox
<input type="text" name="input" value="" />

Can you please let me know proper CSS style for the same

Thank you in anticipation
numberwhun's Avatar
Site Moderator
 
Join Date: May 2007
Location: New Hampshire
Posts: 2,565
#2: Oct 12 '09

re: proper CSS style for Textbox


Quote:

Originally Posted by rahulephp View Post

I want to change the properties of text inside Textbox
<input type="text" name="input" value="" />

Can you please let me know proper CSS style for the same

Thank you in anticipation

First, I have moved your thread over here to the HTML/CSS forums. Since this is obviously a CSS question, it did not belong in the PHP forum. You need to please be sure and post your question under the most appropriate forum topic next time.... please.

As for your question, what do you want to change? The input area will be blank until the user enters something. But, if you want to play with it to see if you can change it prior to the user entering anything (which I haven't tried or worried about before), you should add a class name to your input link and then, in your CSS play with the different attributes relating to font.

Its not that I am unwilling to show you, but if you don't yet know CSS, then you really need to learn it and there is no time like the present when you need to do something, to learn it.

Regards,

Jeff
TheServant's Avatar
Expert
 
Join Date: Feb 2008
Location: Australia
Posts: 913
#3: Oct 12 '09

re: proper CSS style for Textbox


Quote:

Originally Posted by rahulephp View Post

I want to change the properties of text inside Textbox
<input type="text" name="input" value="" />

Can you please let me know proper CSS style for the same

Thank you in anticipation

Either add a class to the input:
Expand|Select|Wrap|Line Numbers
  1. <input class="myclass" type="text" name="input" value="" />
With the css:
Expand|Select|Wrap|Line Numbers
  1. .myclass { font-size: 6px; text-decoration: underline; }
Or add a class to the surrounding div:
Expand|Select|Wrap|Line Numbers
  1. <div class="myclass">
    <input type="text" name="input" value="" />
    </div>
With the css:
Expand|Select|Wrap|Line Numbers
  1. .myclass input { font-size: 6px; text-decoration: underline; }
Member
 
Join Date: Sep 2009
Location: London
Posts: 36
#4: Oct 13 '09

re: proper CSS style for Textbox


If u dont want to use external style sheet u can use style properties as below.

Expand|Select|Wrap|Line Numbers
  1. <input type="text" style="text-align: right;" value ="">
Reply