Jump to content

odd container issues


mattrd
 Share

Recommended Posts

okay, I have a container div holding all the other divs in the site. the problem is when you shrink the browser window, it goes left off the screen but the browser doesn't allow you to scroll left to see what isn't being shown, it only allows you to scroll right. I looked at my css and I don't see any problem, I compared it to other css codes that are similar and their's works fine, but mine doesn't. Can anyone help me out? I would really appreciate it. here are the links.http://crccreek.ianncomm.comhttp://crccreek.ianncomm.com/css/style.cssThanks in advance to anyone for their insight.

Link to comment
Share on other sites

here's the css code that is causing the problem.

#container {	width:785px;	/*height:auto;*/	border-left: 1px solid #000000;	border-right: 1px solid #000000;	left:50%;	position:absolute;	margin-left:-397px;	margin-top:0px;	background-color:#E4F3D4;	overflow:hidden;}

I tried setting margin-left and margin-right to auto and it worked, but when view in 800 x 600, I had the option to scroll slightly to the right. I don't want to be able to scroll at all. I tried shrinking the container even more, but it didn't solve the problem.

Link to comment
Share on other sites

AH! I see what you mean. Hmmm that's weird, never seen that before. I'll check your code.Why do you have this: left:50%; position:absolute; margin-left:-397px; margin-top:0px; overflow:hidden;

Link to comment
Share on other sites

AH! I see what you mean. Hmmm that's weird, never seen that before. I'll check your code.Why do you have this: left:50%; position:absolute; margin-left:-397px; margin-top:0px; overflow:hidden;
that's how i've always centered container divs. i position it absolutely, move 50% to the left, the give it a negative left margin which is half of the width to move it back. now I know there is a flaw... i don't know of any other way to position a container into the center except for the margin-left:auto and the margin-right:auto, but that for some reason allows scrolling in 800 x 600. :)
Link to comment
Share on other sites

This could solve some problems, center your div like this:body { text-align: center; }maincontainer { margin: 0 auto; text-align: left; }
wow. it actually works! I could have sworn i tried the margin:0 auto; but i thought made the container stay to the left... Thanks so much! but the problem still remains in 800 x 600 that the bottom scroll bar appears and allows you to scroll a little bit to the right, and decreasing the container size doesn't fix it. wanna try and tackle that one??
Link to comment
Share on other sites

I see the problem you have with your site.Still have those in your css?position:absolute;overflow:hidden;I think those are the reason for your problem. Try commenting them out.

Link to comment
Share on other sites

okay, you can view it here: http://www.matthewrdaniels.com/crctest/crctest.html the images don't work, but it doesn't matter, you will at least see what i am talking about.

I see the problem you have with your site.Still have those in your css?position:absolute;overflow:hidden;I think those are the reason for your problem. Try commenting them out.
they were already taken out.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...