Reputation: 3414
Situation:
position:fixed;
bar at the top.Question: How can the layout be changed (HTML, CSS) so that the first lines of the textarea become visible through keystrokes inside the text area?
I have tried:
To be clear: some of these measures help that the whole text area becomes visible when the mouse is used to scroll to the top. The textarea should be accessible fully through the cursor keys on the keyboard.
Demo: jsfiddle
Upvotes: 0
Views: 1280
Reputation: 3661
You could probably do something like this: https://jsfiddle.net/dxg4anaf/4/
.text {
border-top: 18px solid transparent;
height: 100%;
overflow-y: auto;
padding: 10px;
box-sizing: border-box;
}
Making scrollable just the div with textarea, not the container of both that div and the top div. The padding between textarea and its top would still not be visible when you scroll with keyboard, but at least all of the textarea will.
Can't think of a better way.
Upvotes: 2
Reputation: 5615
add default rows
and cols size
<textarea rows="20" cols="50">
first line
..
..
</textarea>
and remove height:10000px;
in css of textarea
textarea {
margin-top:30px;
height:10000px;
}
css should be like
textarea { margin-top:30px;}
Upvotes: 0