Loading...
 
Skip to main content

Themes


Setting the overall width of the tikiwiki site

Hi all,

Can someone tell me how to set the maximum width of a tikiwiki site. In this case I would like to restrict the maximum size to 800 px wide and to center this in the users display if they are using a higher resolution.

Any help appreciated

Tim


Actually a little more is necessary. To give the best answer, it'd be good to know what theme you're using, as Tiki's themes don't all use the same construction method. Generally speaking, to have the content in an 800px-wide area that's centered in a wider browser window, you'll need to give the width to an element within the body tags. For example, in most themes, there's a div class="main" that contains everything. So in the stylesheet, you'll have to add something like this:

body {text-align: center}
div.main {width: 800px; margin-left: auto; margin-right: auto}

That said, I'm not sure what the behavior is of Tiki when the content width is limited in this way. Most themes now are designed to be full-width and use a method of floating divs to position the columns. In my tests in the past, behavior was erratic especially in IE7 when I tested limiting the width. The answer for me was to use a different method to make that type of layout, one that uses a table or two to contain the content. This method, although old-school, is stable even in IE7.

-- Gary

I've been able to create customs themes using a set width with some success. I've used the same CSS-centering code as chibaguy provided. Ultimately, of course, its not a tikiwiki problem but a CSS compatibility problem across browsers. 🙁