0

A field has a placeholder :

<input type="text" name="clt_cin_pass" id="clt_cin_pass" maxlength="25" placeholder="CIN/Passeport" value="foo" />

How to place the placeholder's text , here CIN/Passeport, at the field's right ?

Navid EMAD
  • 382
  • 1
  • 15
pheromix
  • 18,213
  • 29
  • 88
  • 158
  • This question is quite similar to [Change an input's HTML5 placeholder color with CSS](https://stackoverflow.com/q/2610497/448591) – Jakob Runge Jul 24 '15 at 07:39

2 Answers2

0

I have created a jsFiddle for you pheromix,

https://jsfiddle.net/69sp620q/1/

Html

<input type="text" name="clt_cin_pass" id="clt_cin_pass" maxlength="25" placeholder="CIN/Passeport" />

CSS

input[type='text']{
text-align:right;
}

Of course you can update this to target a class not just all input tags

Canvas
  • 5,779
  • 9
  • 55
  • 98
0

/* webkit solution */
::-webkit-input-placeholder { text-align:right; }
/* mozilla solution */
input:-moz-placeholder { text-align:right; }
<input type="text" name="clt_cin_pass" id="clt_cin_pass" maxlength="25" placeholder="CIN/Passeport" value="" />
Navid EMAD
  • 382
  • 1
  • 15