Thursday, 9 September 2021

HTML CSS - Add background HTML text to textaread instead of place holder

https://stackoverflow.com/questions/16550717/how-to-add-a-background-text-to-textarea-tags 

HTML:

<div class="wallpapered">

    <div class="background">Some background text...</div>

    <textarea></textarea>

</div>


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;

}



No comments:

Post a Comment