Click to See Complete Forum and Search --> : Problem with background/sidebars


halfmoon7
02-09-2010, 08:23 PM
Hi,

I just got into web design and my friend referred me to this site after not being able to resolve one of my problems, so I will probably be searching for answers on here pretty often from now on haha. But okay, I searched through posts here and couldn't find a solution (most likely because I don't really know what to call the problem). What I'm trying to do is create a site with a main portion in the center and two 'sidebars' I guess on the sides (more like a background) but I do not want them to expand or contract. I can't seem to find a way to keep them fixed in place.
Here's an example of how I would like my page to be formatted: www.deadmau5.com. The sidebar area would be the gray parts on the far left and right.

Thanks in advance and sorry if I've repeated a thread!
Zach

Major Payne
02-09-2010, 10:00 PM
Try using the CSS property, min-height (http://www.w3schools.com/CSS/pr_dim_min-height.asp): XXXpx;, on the content container you wish to fix to a set height. Or, look into the Min-Height Fast Hack (http://www.dustindiaz.com/min-height-fast-hack/).

Min-Height for Internet Explorer (http://www.cssplay.co.uk/boxes/minheight.html)
HundredPercentHeight (http://css-discuss.incutio.com/?page=HundredPercentHeight)

There are other alternatives I image.

halfmoon7
02-11-2010, 02:34 AM
I'm not sure that fixes my problem. Notice how on the example website I posted, the grey bars on the sides disappear until only the main website is showing when you shrink the window size. That is what I am trying to achieve. I know there are templates to use that give a general gray background that does what I am looking for, but I cannot find how to place a picture on that to make it look nicer.

savvykms
02-14-2010, 05:08 PM
This is easily accomplished. The main page should be within a <div> or <table> element, which has fixed dimensions. Then that element is centered on the page containing all the content etc. The background color or image for the page can then be the color/image of the sidebars. They will be equal in size and expand/contract depending on the window size.