/    Sign up×
Community /Pin to ProfileBookmark

DIV not affect horizonal scroll

Hi,

I have a page that’s center aligned on the screen and what I would like to do is add div right next to the right edge of the page outline but do not want that div to affect width of the page. So div doesn’t create horizontal scroll and page is still centered as it was before the div. is something like this possible?

Thanks

to post a comment
CSS

5 Comments(s)

Copy linkTweet thisAlerts:
@tinimicJun 11.2010 — Can you post a link to the current page? It's almost impossible to post a solution without a reference layout.
Copy linkTweet thisAlerts:
@tinimicJun 12.2010 — I'm still not sure what you want, exactly. But take a look at this and tell me if it's something like you had in mind.

http://tinimi.com/for_others/TiGGi/MensHealth_rev.htm

You can get by with a 200 px (or so) addon sidebar for monitors with more than 1000 px width resolution.

There would be a scroll bar on 800 x 600. Also, since your pages are generated HTML, I don't see how you are going to do it, unless you have access to the server modules.
Copy linkTweet thisAlerts:
@TiGGiauthorJun 14.2010 — tinimic,

Thank you for your help. That's similar to what I want, I just want that sidebar to be outside the content outline and also I want the page to be centered based on the main content and ignore the sidebar.
Copy linkTweet thisAlerts:
@tinimicJun 15.2010 — In that case, it's easy to place an absolutely positioned div outside your container.

Just change:

[CODE]<div id="container">[/CODE]

to

[CODE]<div id="container" style="position:relative;">[/CODE]

then add the following line of markup:

[CODE]<div style="position:absolute; left:758px; top:120px; width:120px;">Content for your sidebar goes here.</div>[/CODE]

You can play around with width, height, padding, etc. to get the size of the div to your design. You'll get a scroll bar if the browser window is less than the combined width of your container and sidebar, but your container will remain centered on wider windows.

Hope this helps.
×

Success!

Help @TiGGi spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...