jquery - How to add a background text to textarea tags? -


you know can add image background image textarea using :

textarea {  background:#fff url(background.png) no-repeat center scroll;  } 

how can have text (not image, nor text image) background textarea ?

it isn't text contained in textarea itself. text behind. user can write in textarea, and, background image, see background text behind.

css2 preferred, css3 , js ok.

there brute force approach:

<div class="wallpapered">     <div class="background">some background text...</div>     <textarea></textarea> </div> 

with following css:

.wallpapered {     width: 400px;     height: 300px;     position: relative;     outline: 1px dashed blue; } .wallpapered textarea {     width: inherit;     height: inherit; } .wallpapered .background {     position: absolute;     top: 0;     left: 0;     color: gray; } 

fiddle


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -