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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:07:02+00:00 2026-05-23T18:07:02+00:00

I have vertical floating div: <div id=twitter-right-vrtical style=position: fixed; bottom: 415px; right: 446px; display:

  • 0

I have vertical floating div:

 <div id="twitter-right-vrtical" style="position: fixed; bottom: 415px; right: 446px; display: block">
        <img src="/Content/themes/start/images/twitter.png" title=""/>
    </div>

When page content contains scroll the div perfectly attached to content:

enter image description here

But when page does not contains scroll there is a couple of pixels gap between floating div and page content:

enter image description here

How i may fix that?

I think i should check the position of content or check if there is a scroll on page and set position of div according with content dynamically using jquery?

simple demo here http://jsfiddle.net/KEeqe/8 just change height:1710px to 500px – 400px and you will see what i mean

  • 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-05-23T18:07:02+00:00Added an answer on May 23, 2026 at 6:07 pm

    You don’t need JavaScript for this.

    In your jsfiddle, you have a div that presumably contains your page content and a little twitter button that you want to have fixed to the right side of it. Since your content div is set to width: 80%, just give your twitter button left: 80%. It is off by a few pixels because of borders and padding, so use margin-left on the twitter button to fix it. In your jsfiddle, there’s a 2px gap, so you will want to apply margin-left: -2px. Here’s the simple, non-js fix: Tadah!

    If you had a fixed width content div that was centered, you’d run into the same problem. The solution is similar: Position the twitter button in the center with a left margin that is half the width of the content, plus the border. So, if the content is fixed at 400px wide and centered, you’d position your twitter button thusly: left: 50%; margin-left: 202px. Tadah!

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

Sidebar

Related Questions

Desired Outcome I want to have Vertical List with custom items on the left/right
i have problem with image vertical-align in div .img_thumb { float: left; height: 120px;
I want to have a vertical text (going from top to bottom instead of
I have a container DIV with a fixed height and width (275x1000px). In this
I have container div (gray box) with floating elements inside: Bars are floating to
So I read through the thread How to get Floating DIVs inside fixed-width DIV
I have vertical submenu as under: <div id=dropdown_menu class=menu> <ul> <li> <a>First Link</a></li> <li>
I have a (vertical) UISlider inside a UIScrollview. I'd like to be able to
I have a vertical menu having an item Click here to get the scientific
I have a vertical StackPanel with two elements: a Button and a ListBox. How

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.