Ermu Posted March 30, 2012 Posted March 30, 2012 Hey! So my problem is that my site looks perfect when it's on fullscreen, but when you resize the browser window, it will go out of the screen from the right side.I'd like it to be like normal sites that, when you resize the window and it's about to go out of the screen, it will ignore the "margin" and glide to left corner and "attach/stick" to it. Everything in HTML is inside <div id="contain"> tag. I hope you understood, if you didn't ask for a better explanation. Thanks, Ermu. ----------CSS----------- @charset "utf-8"; /* CSS Document */ * { margin:0; padding: 0; } html, body { height: 100%; width: 100%; padding: 0; margin: 0; } #full-screen-background-image { z-index: -999; min-height: 100%; min-width: 100%; width: 100%; height: 100%; position: fixed; top: 0; left: 0; } h1 { font-family:Arial, Helvetica, sans-serif; font-size:42px; color:#000000; text-align:center; text-decoration:underline; } h2 { font-family:Arial, Helvetica, sans-serif; font-size:30px; color:#000000; text-align:left; text-decoration:underline; } h3 { font-family:Arial, Helvetica, sans-serif; font-size:22px; color:#000000; text-align:left; text-decoration:none; } #contain { margin-left:25%; margin-top:4%; margin-right:25%; margin-bottom:0px; } #TBFLogo { margin-right:0px; margin-left:0px; margin-bottom:0px; margin-top:0px; width:900px; height:500px; border-width:14px; border-bottom-width:0px; border-color:#000000; border-style:solid; background:url(Images/planks.png); } #Mainbox { margin-left:164px; margin-right:0px; margin-bottom:0px; margin-top:0px; border-bottom-width:14px; border-right-width:14px; border-left-width:14px; border-top-width:14px; border-style:solid; border-color:#000000; position: relative; background:url(Images/planks.png); width:720px; padding-right:8px; padding-left:8px; padding-top:20px; padding-bottom:20px; } #Mainbox a { color:#00FF00; } #Sidebarbg { background:url(Images/planks.png); } #Sidebarlowestpad { border-bottom-width:0px; border-top-width:0px; border-right-width:0px; border-left-width:0px; border-style:solid; border-color:#000000; } #Sidebarblock { border-bottom-width:14px; border-top-width:0px; border-right-width:0px; border-left-width:0px; border-style:solid; border-color:#000000; } #Sidebar { margin-left:0px; margin-right:0px; margin-top:0px; margin-bottom:0px; border-top-width:14px; border-bottom-width:14px; border-right-width:0px; border-left-width:14px; border-style:solid; border-color:#000000; position:absolute; background:url(Images/planks.png); width:150px; } #Sidebar ul { list-style-type: none; padding: 0; text-decoration:none; color:#000; } #Sidebar a { font-family:Arial, Helvetica, sans-serif; color:#000000; text-decoration:none; font-size: 130%; font-weight: bold; display: block; padding: 4px; padding-right:70px; } #Sidebar a:hover { background:url(Images/planksdark.png); color: #FFF; } #copyright { border-width:6px; border-style:solid; border-color:#000000; margin-bottom:0px; margin-top:8px; margin-left:170px; margin-right:0px; width:724px; padding: 6px; font-style:oblique; font-weight:bold; font-family:Arial, Helvetica, sans-serif; font-size:12px; background:url(Images/planks.png); }
Ice IT Support Posted March 31, 2012 Posted March 31, 2012 For #contain, try using:margin-left: auto;margin-right: auto;This is what I use on my site and it does what I believe you are describing.
snowdog Posted April 2, 2012 Posted April 2, 2012 For #contain, try using:margin-left: auto;margin-right: auto;This is what I use on my site and it does what I believe you are describing. Same here, should work fine. Let us know if not.
Ermu Posted April 5, 2012 Author Posted April 5, 2012 Now it will just go either to the left or right side, depending on float, with 0 margin even on fullscreen. Even with clear:both; float:none; or left or right.
anush Posted April 6, 2012 Posted April 6, 2012 LOL it is because you used fixed positon for all elements so the reference point is left side top corner of the browser, try to redesign it without using fixes position for all elements. if you can tell the link i can give you suggestion for the css.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now