Centering a place and entering text in a text box

I was wondering if it is possible to center the placeholder and input that the user will enter into the text box. I suppose this is possible, but I cannot figure it out. Can anyone help? my code for the text box in question is below ...

<input type="text" style="font-weight:bold:" name="kword" id="kword" autofocus ="on" placeholder="Enter Keyword(s)" autocomplete ="on"/> 

thanks

+7
source share
3 answers

..........................................

Demo

Hi is now used for text-align:center

this css

 input, input[placeholder]{ font-weight:bold; color:red; text-align:center; } 
+4
source

I believe you are looking for something like this: http://css-tricks.com/snippets/css/style-placeholder-text/

Since its new feature is not fully compatible with the browser, but in browsers that support the placeholder attribute, this will allow you to style it as you like.

+2
source
 ::-webkit-input-placeholder { text-align: center; } :-moz-placeholder { /* Firefox 18- */ text-align: center; } ::-moz-placeholder { /* Firefox 19+ */ text-align: center; } :-ms-input-placeholder { text-align: center; } 
0
source

All Articles