Centering problem?

Skinning and designing Serendipity (CSS, HTML, Smarty)
Post Reply
constantin3
Posts: 3
Joined: Tue Sep 30, 2008 3:05 pm

Centering problem?

Post by constantin3 »

Hi there,

A total newbie here - have installed serendipity on my local laptop here to play around with it before making it live.

I'm looking to make the page centered and not be the full width of the browser page.

Is this easy to do? If theres a dummies guide please point it out to the newbie!

Thanks in advance,

constantin3
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

That depends on what template you are using..... which one is it?
=Don=
constantin3
Posts: 3
Joined: Tue Sep 30, 2008 3:05 pm

Post by constantin3 »

That would be useful wouldn't it!!

I'm using the coffee cup theme.
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

To accomplish this, you'll either need to install a template (also called a theme) that implements centering the way you like it, or you'll have to get involved with templating yourself.

Luckily, templating is not so difficult. (Web design is difficult, and we have some very talented people here. But even they will tell you that modifying templates is not too hard.) We use Smarty for our template engine. The top file is index.tpl; it defines the page layout, so it's where you'd want to make changes.

However, you may not need to go that far. We also make extensive use of CSS. The style.css file in the current template directory is the one to make changes to; if your theme already has a wrapper div, you should be able to simply change its width and positioning.
Judebert
---
Website | Wishlist | PayPal
judebert
Regular
Posts: 2478
Joined: Sat Oct 15, 2005 6:57 am
Location: Orlando, FL
Contact:

Post by judebert »

Whoops. Late posting. Sorry.
Judebert
---
Website | Wishlist | PayPal
Don Chambers
Regular
Posts: 3657
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

constantin3 wrote:That would be useful wouldn't it!!

I'm using the coffee cup theme.
Not sure if I have the most recent version of that template or not, but in the template's folder is a file named style.css. Open that file with a simple text editor.

Look for this:

Code: Select all

#mainpane {
    border-bottom: 1px solid #000000;
    margin: auto;
    margin-top: 10px;
    width: 90%;
    background-color: #FFFAF0;
}
The width is specified as 90% of the browser window. You could reduce that percentage, or make it a specific width in pixels.
=Don=
constantin3
Posts: 3
Joined: Tue Sep 30, 2008 3:05 pm

Post by constantin3 »

That worked a treat, thanks Don.
Post Reply