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 8885345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:17:14+00:00 2026-06-14T21:17:14+00:00

I have a div with text on the right and a div with a

  • 0

I have a div with text on the right and a div with a menu on the right. Both wrapped up with a div to center it all. Ho can I make the div right follow the screen when the user makes scroll with the text? I mean that the div right keeps “fixed” in the same place but the user could make move and scroll the text.(This is not a classic fixed position. I’m not sure if I should call this something like a fixed relative to another div?)

HTML:

<div id="wrapper">

<div id="text">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque convallis adipiscing dolor, eget rutrum lectus malesuada id. Phasellus vulputate, lorem et convallis vulputate, enim nulla scelerisque nunc, vel auctor orci tellus eget diam. Praesent scelerisque, mauris a molestie lobortis, lectus nisi dignissim massa, eget tempor ante sem in nisi. Proin fermentum euismod ullamcorper. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Proin nec orci arcu. Nullam molestie consequat porttitor. Pellentesque sit amet nisl odio. Ut vel mi a eros commodo vehicula sagittis ut mi. Donec eu ante velit, vel ullamcorper arcu. Etiam eros sapien, lobortis a porttitor quis, congue vel velit. Nam et dui auctor augue interdum interdum.<br /><br />

</div>

<div id="right"></div>

</div><!-- final de contingut -->

CSS:

body {background-color: #f2f2f2;font-size: 13px;margin: 0;padding: 0;}

#wrapper {margin:0 auto;width:700px;height:900px;background-color:#fff;}

#right {
    float:right;
    width:200px;
    height:500px;
    right:0px;
    border:solid thin #f00;
}

#text {
    float:left;
    width:400px;
    padding:40px;
}

I have the example here: http://jsfiddle.net/u7xRX/1/

  • 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-14T21:17:15+00:00Added an answer on June 14, 2026 at 9:17 pm

    After a lot of time I could find a solution with just css. I think in fixed position if you don’t give the right position it gets it from the parent div, in this case the wrapper. On the other side, I add a margin to position it on the right

    http://jsfiddle.net/u7xRX/3/

    body {background-color: #f2f2f2;font-size: 13px;margin: 0;padding: 0;}
    
    #wrapper {position: relative; margin:0 auto;width:700px;height:900px;background-color:#fff;}
    
    #right {
        position: fixed;
        top: 40px;
        /* right:0px; important not give right position */
        width:200px;
        height:200px;
        margin:0 0 0 500px; /* important to position it on the right */
        background-color: red;
    }
    
    #text {
        position: absolute;
        left: 0px;
        width:400px;
        padding:40px;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a div on the left hand side, and text on the right
I have a div element containing some text. When the user clicks a word
I have 1 div and 1 text input field, the div is visible and
I have a div which has some text, but according to different situations this
I have a div, containing text and a few links. I want to trigger
I have two div's one has textbox in it and other just plain text.
I have a div with a width of 200px. There is text inside that
I have a div. When there is a big text then scroller comes on
i have a click event for $('#blah div'). div has text inside of it
I have this div in my code: <div id=advice class=validation-advice style=>some text here</div> Now,

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.