Position left floating div from content and not left of page

adrian5

New Member
In my web page, I have a div that stays static on the left even as the user scrolls.This is the CSS for the div:\[code\].floatingDiv{ position:fixed; top:300px; left:70px; padding:16px;}\[/code\]As you can see, I am positioning the div relative to the top left corner of the page.However, my main content is only about 1000px wide, and I want to position this div from the left edge of my content rather than the left edge of the screen. At my resolution of 1440x900, the div currently is placed exactly halfway between the left edge of the screen and the left edge of the content, but if someone is using a wide-screen monitor, this floating div is rather far away from the content.
 
Top