troubleshooting Question

CSS/HTML: Sideborders and having them cut off when the window is too small.

Avatar of Valleriani
VallerianiFlag for Sweden asked on
CSSHTMLPHP
9 Comments1 Solution279 ViewsLast Modified:
I have the following image here for an example; background
As you can see, I have two side borders and the main content area. It looks like it works here (ignore the white area atm) but I have an issue.

If you size your browser down (aka size the window or have a smaller monitor) the page starts at the sidebar image. I want it to slowly crop out until only the MAIN area is there. Thing is it would need to crop out both sides evenly, I've seen some sites that do it but I'm not sure how.

So in the end there would be no side borders and only the main content area as the minimum width. It shouldn't consider the sidebar images as part of the content, thus making it so the minimum window size is alot larger.

My coding is pretty simplistic:

.outer {
	width:1187px;
	margin-left:auto;
	margin-right:auto;
	border:0;
	background:#000000 url('../images/bg-left.png') repeat-y left top;
	padding-left:109px;
	height:100%;
 }

.inner {
	background-color: #FFF;
	background-image: url('../images/bg-right.png'), url('../images/bg-middle.png');
	background-repeat: repeat-y, no-repeat;
	background-position: right top, left top;
	padding-right:113px;
	height:100%; margin: 0 auto -4em;
 }
 
* html .inner {height:1%}

and the HTML is:

<div class="outer">
<div class="inner">
</div></div>


Does anyone have an idea on what I should do here?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 9 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros