Maybe somebody can help me with this problem: I'm looking for a javascript-free solution to show lines in a textarea. The accepted answer here does not work for me because it depends on a fixed line-height inside the box.
My textarea looks like this:
textarea{
line-height: 2em;
}
so an image-only-solution does not work. Is there something, maybe CSS3-related, that could archive that? I've tried
background: url('whitepx.png') repeat left 2em #363636;
but that colors the whole textarea white.
UPDATE
I think I got it. Sorry if I couldn't make my question clear enough.
This is my css finally:
textarea
{
width: 100%;
background-color: #363636;
border: 1px solid #fff;
outline: none;
color: #fff;
font-size: 14px;
display: block;
padding: 0 0 0 1em;
line-height: 2em;
font-family: sans-serif;
resize: none;
height: 58em;
width: 530px;
background-image: -moz-repeating-linear-gradient(#363636, #363636 20%, #fff 22%);
background-image: -webkit-repeating-linear-gradient(#363636, #363636 20%, #fff 22%);
background-image: -o-repeating-linear-gradient(#363636, #363636 20%, #fff 22%);
background-image: -ms-repeating-linear-gradient(#363636, #363636 20%, #fff 22%);
background-image: repeating-linear-gradient(#363636, #363636 20%, #fff 22%);
background-size: 100% 2em;
background-attachment: local;
}
See this fiddle. Looks good enough to me.