Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8645779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T12:38:18+00:00 2026-06-12T12:38:18+00:00

I know this is bit difficlut to explain but you’ll get an idea by

  • 0

I know this is bit difficlut to explain but you’ll get an idea by seeing my code below, the situation is I’ve a textarea which having a line background(something like notebook and the image style is repeat), also the textarea become fixed height for eg. 300px, so my question is when a scroller comes I want to stick the lines with the text, now the text is scrolling and the background lines stay back into a fixed position..

Just tell me your suggetions, is that possible to scroll the background lines together with the text?

Here is my html code..

<div style="width:500px; height:300px; margin:0px auto; background:#ebebeb;">
<textarea style="width:100%; height:300px; background:url(line.jpg) repeat; line-height:30px; font-size:20px; font-family:Georgia, 'Times New Roman', Times, serif;" name="" cols="" rows=""></textarea>
</div>

and here you can see the image – {
enter image description here }

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T12:38:19+00:00Added an answer on June 12, 2026 at 12:38 pm

    Use background-attachment: local; after you set your background image.

    demo

    Works in IE9+, Firefox 5+, Safari 5+, Chrome and Opera

    HTML:

    <div>
        <textarea>
            background-attachment: local;
            <!-- and so on, many more lines -->
            background-attachment: local;
        </textarea>
    </div>
    

    CSS:

    div {
        width: 500px;
        margin: 0 auto;
        background: #ebebeb;
    }
    textarea {
        display: block;
        width: 100%;
        height: 300px;
        background: url(https://i.stack.imgur.com/EN81e.jpg);
        background-attachment: local;
        font: 20px/1.5 Georgia, 'Times New Roman', Times, serif;
    }
    

    EDIT

    Another better compatibility solution (only browsers in which this doesn’t work are Opera Mobile and Opera Mini) would be not to use a textarea, but another div with a contenteditable attribute.

    demo

    HTML:

    <div class='outer'>
        <div class='inner' contenteditable='true'>
            background-attachment: local;
                    <!-- more stuff -->
            background-attachment: local;
        </div>
    </div>
    

    CSS:

    .outer {
        overflow-y: scroll;
        width: 500px;
        height: 300px;
        margin: 0 auto;
        background: #ebebeb;
    }
    .inner {
        width: 100%;
        min-height: 300px;
        background: url(https://i.stack.imgur.com/EN81e.jpg);
        font: 20px/1.5 Georgia, 'Times New Roman', Times, serif;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this is a bit bleeding edge, but here's the question anyway: Given
I know this is a bit generic, but I'm sure you'll understand my explanation.
I know this topic is bit old, but i did surf the web and
I know this might be a bit awkward but I am trying to modify
What does this bit of code represent? I know it's some kind of if
I know this has a stupid solution but, sorry, I'm little bit confused. I
This might sound a bit of an odd question but I know what I
This might be a bit difficult to explain but I have two columns in
This was a bit difficult to explain in the title, but I should be
I'm sorry if this is a bit of a C-noob question: I know I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.