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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:16:13+00:00 2026-06-15T11:16:13+00:00

When I positioning my wrapper absolute and right there is no horizontal scrollbar triggered

  • 0

When I positioning my wrapper absolute and right there is no horizontal scrollbar triggered when I shrink the window.

Example:
http://jsfiddle.net/Ue6aN/

Code:

<div id="wrapper"></div>


#wrapper {
 width: 400px;
 height: 400px;
 position: absolute;
 right: 20px;
 top: 0px;
 border: 1px solid red;
}

If I switch right: 20px; to left: 20px; it’s working, but not otherwise. Any idea how to fix that without javascript?

  • 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-15T11:16:14+00:00Added an answer on June 15, 2026 at 11:16 am

    The problem is that there is no content following #wrapper. To get a horizontal scroll there has to be content anchored on the left edge of the document that becomes hidden when the viewport is narrowed, or said content exceeds the viewport width. Since #wrapper is floating right, that’s impossible because it has no left-side anchor point. :after makes it work though.

    #wrapper { float:right ... }
    
    body:after {
        clear:right;
        content:' ';
        display:block;
        height:1px;
        min-width:420px
    }
    

    The CSS above adds a space after the content of body, which is #wrapper. That space is at least the width of #wrapper‘s box model, but has no float, and is anchored to the left edge of the viewport. So… as soon as its far right edge is hidden, the horizontal scrolling is triggered; thus giving the illusion that #wrapper is causing the scroll event.

    The fiddle: http://jsfiddle.net/jg3nH/

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

Sidebar

Related Questions

I'm trying to align the links in http://www.jsfiddle.net/uAXkM/ to the center. The links are
I'm having a problem with positioning my navigation element. CSS: #wrapper { width: 600px;
Ive used absolute positioning and CSS3 animations so clicking a trigger div makes another
I am having trouble positioning a (div) element at the top right of a
which type of positioning (absolute or relative) and units (percentage,em,px) should be used to
DIV1 (relative positioning) has a variable number of other DIVS (absolute positioning) inside of
I cant seem to get the css positioning right so that a new line
Having difficulties with ie7 bug involving absolute positioning. Have tried a few solutions without
Absolute positioning is great, but it seems to position it relative to the browser
I've done absolute positioning on Android via density independent pixels and it works great

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.