简体   繁体   中英

Two different text styles in placeholder

Is it possible to have two styles in an input box placeholder?

Here is an example of what I'm looking for: http://i.imgur.com/uQ3zf.png

Options would be use a background image that has the text, or use an element overlay with th text or put the text behingd the imput.

Here's a simple demo that places the text behind the input and hides it on focus

http://jsfiddle.net/GRsQc/1/

One solution would be to position text over the input field, obviously it can be styled as pre your example and hide the text using jquery or javascript when the text field is selected. If you want to provide some code I can be more specific.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM