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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:46:59+00:00 2026-06-10T16:46:59+00:00

I have positioned a sidebar element at the right side of the visible part

  • 0

I have positioned a sidebar element at the right side of the visible part of the screen (this part already works!). The sidebar consists of several DIVs. A few of them I don’t care about, but the last (lowest) one should not “disappear” when the user scrolls down the page. And here is where I’m stuck. In a way, the top position should not be < 0 of the visible top of the browser window. Is that even possible with CSS and the better browsers?

Here is my definition of the sidebar:

div#sidebar{font-size:95%; float: right;width: 150px; margin-top:20px;}
div#sidebar div{padding: 5px 0;margin-bottom: 5px}

Here is the element I would like to keep inside the visible part of the screen:

div#navtop{background:#B3B3E3 url(/css/blue.jpg); margin-bottom:0px;}
div#navsoc{background:#B3B3E3 url(/css/blue.jpg); margin-bottom:0px; top:!important 0px;}

The second element, “navsoc”, should remain in the visible part. But it moves exactly like “navtop” and the others I have defined there.

<div id="sidebar">
<div id="navsoc">
keep me inside the window!
</div>
</div>
  • 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-10T16:47:00+00:00Added an answer on June 10, 2026 at 4:47 pm

    I think you need

    position:fixed;
    

    So the element will be positioned relatively to the window, so if you scroll it is always visible.

    Demo: http://jsfiddle.net/mJubt/

    Moreover, if you want to set !important to a value, use top:0!important instead of top:!important 0.

    And when you have 0px you don’t have to write the unit, you can use just 0.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a sidebar that I have positioned absolutely to the right for several
I have a left-positioned navigation that shows/hides content on the right. Currently, when you
I have a canvas element positioned absolutely over a Flash object of the same
I have 2 divs that positioned horizontally ( float:left; width:50%; ). But i want
I have a UIScrollView added and positioned via Interface Builder, as part of a
I have an article 'tag' sidebar which is positioned correctly on the Home page,
I have a small problem. I am trying to align two divs side by
Here I have a div in a right sidebar that supposed to act in
Here I have a div on the bottom of right sidebar that supposed to
I have this basic script that makes an element show onmouseenter, and hide onmouseleave.

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.