textarea with horizontal rule
You can do this using linear gradients:
.notes {
background-attachment: local;
background-image:
linear-gradient(to right, white 10px, transparent 10px),
linear-gradient(to left, white 10px, transparent 10px),
repeating-linear-gradient(white, white 30px, #ccc 30px, #ccc 31px, white 31px);
line-height: 31px;
padding: 8px 10px;
}
<textarea class="notes"></textarea>
Textarea with lines under each row of text
I have created this for you in jsfiddle, is this what you are looking for?
<style>
._ta {
background-color:#AADDF2;
padding:10px;
}
._ta textarea {
background: transparent url(http://s24.postimg.org/62v2ipx81/underline.png) repeat;
border:none;
height:150px;
width:300px;
overflow:hidden;
line-height:30px;
font-weight:bold;
color:#FF9900}
</style>
<div class="_ta">
I like my name because:<br />
<textarea></textarea>
</div>
demo:
http://jsfiddle.net/TV47t/1/
Underlining text of a textarea
The approach being used is to hide the textarea and create a div that is editable (add the attribute contenteditable="true"
to a div. I'm not too sure of browser compatibility). On every key press the javascript grabs all the content, locates mis-spelled words and puts a span around the offending word. Using css they put a squiggle red underline under the word (an image of a small segment of red squiggle)
Thinking about it, they would need to keep track of the location of the cursor in the div in case the user starts entering text in the middle of the box, so that after altering the contents the script returns the cursor to the correct position and not at the end of the block of content.
Also, you would need to update the value of the textarea on each keypress.
[edit]
Here is a jsFiddle of proof of concept:
http://jsfiddle.net/tEnY8/
Bottom line, when you type into the box, the value is put into the textarea and any incorrect words are underlined and turned red. At the moment it only flags the last word as being incorrect. You need to comment that line out, uncomment the for loop, and implement the isMispelled(String)
function.
[edit]
Here is a further proof of concept: http://jsfiddle.net/tEnY8/4/
Basically I've set up an array of correctly spelled words, then the loop checks if the word exists in the array; if it does not then the word is probably mis-spelled.
textarea with horizontal rule
You can do this using linear gradients:
.notes {
background-attachment: local;
background-image:
linear-gradient(to right, white 10px, transparent 10px),
linear-gradient(to left, white 10px, transparent 10px),
repeating-linear-gradient(white, white 30px, #ccc 30px, #ccc 31px, white 31px);
line-height: 31px;
padding: 8px 10px;
}
<textarea class="notes"></textarea>
Custom CSS Form: How to achieve responsive underlined textarea?
You can implement the constant underlines by making a background image that has some blank space and an underline. Then set the image as background of your textarea and have it repeat. Lastly, set the line-height
in CSS to be equal to the height of your background. The lines will now repeat along with the height of the text.
For the textarea resizing, you can use TrungDQ's answer or one of many libraries available through Google.
How to underline every line of text, to the end of a block
in your lines that you need to underline add a style="border-bottom: 1px solid #000"(probably on your containing td)
Related Topics
How Remove Border Around Image in CSS
Is Google.Loader.Clientlocation Still Supported
Grails: Displaying Created Image in Gsp
How to Make Images Stay Within the Rows of a CSS Grid Container
Flexbox Layout Does Not Work in Internet Explorer 10
How to Start a New Line with a Particular Item with Flexbox
How to Achieve Curved Top Pointer
CSS Wrong Appearance of Border-Radius on a Nested Div
Restoring the Value of a Input Type=File After Failed Validation
Remove ':Hover' CSS Behavior from Element
How to Strike Through Obliquely with CSS
How to Set the Thumbnail Image on HTML5 Video
How to Implement Curve Background in CSS
Scroll Bootstrap 4 Nav-Tabs Horizontally
Pure CSS Continuous Horizontal Text Scroll Without Break
Pre Code Blocks Stretch the Content Beyond Screen Width in a Centered Flex Container