Reputation: 7964
I need to show lines in my text-area to make it look a like notepad. I have a single text-area only. The below notepad is for reference.
Upvotes: 10
Views: 6106
Reputation: 3717
Here's an idea: http://www.bookofzeus.com/articles/css-styling-textarea-give-notebook-notepad-look/
In short: set a background-image
and set line-height
to whatever line height the image is using.
Upvotes: 12
Reputation: 23542
This should get you started:
HTML
<textarea class="text">some text</textarea>
CSS
.text {
background: url(https://i.sstatic.net/UfzKa.jpg);
height: 664px;
width: 495px;
line-height: 29px;
padding-top: 136px;
padding-left: 120px;
}
Demo http://jsfiddle.net/ptpgb/4/
Upvotes: 2
Reputation: 3969
You can check try
<textarea class="notepad"></textarea>
.notepad {
background: url(https://i.sstatic.net/ynxjD.png) repeat-y;
width: 600px;
height: 300px;
font: normal 14px verdana;
line-height: 25px;
padding: 2px 10px;
border: solid 1px #ddd;
}
Upvotes: 0
Reputation: 682
Try this one as well
<style type="text/css">
textarea {
background: url(/source/notebook.png) repeat-y;
width: 600px;
height: 300px;
font: normal 14px verdana;
line-height: 25px;
padding: 2px 10px;
border: solid 1px #ddd;
}
</style>
Hope this helps.
Upvotes: 1
Reputation: 16595
You can do this with CSS styling, based on your image, you can do this:
textarea#area {
width: 300px;
height: 400px;
padding: 0 0 0 20px;
line-height: 30px;
background: #fff url("https://i.sstatic.net/UfzKa.jpg") no-repeat -75px -160px
}
See the example fiddle here
Upvotes: 11
Reputation: 557
Adding a background image via CSS should work.
textarea{ background-image:url(notepad.png); color:ff0000; }
Upvotes: 0