Width and centering a theme

Started by nameless, April 15, 2005, 07:25:17 PM

Previous topic - Next topic

nameless

This is the first time I've played with SMF themes. YaBBSE themes were nice and simple. I managed to get the css to match my old YaBBSE/Enigma site. I just can't get the width and the forum centered.

What I am trying to do is make my forum similar to my Wordpress theme that I have successfully ported over to Coppermine. All I need to do is get my forum and I'm good to go. I am modifying Bloc's "mercury" theme. I have the following code to make the board to 760 pixels in style.css

body
{
        background-color: #BAE3F8;
        margin: 0px;
        padding: 0px;
        width: 760px;
}


The board size changed but not the header area. I played around with the width's in the header in "index.template.php" but it did not change.

Can you tell me how I can get the forum in the center of the page? Right now this is what I have below (pic is oriented on the left side of the screen, I need board centered):




Skate, Snow, and Surf - SF Boarders - Bringing San Francisco Bay Area boarders together.

kurotenshi

Add somewhere after <body> to this

<div align="center" style="display: block;">

and before </body>

</div>

And do this in index.template.php :) Or you could also do table to do samething

<table align="center"><tr><td> <-- this after <body>

and

</td></tr></table> <-- before </body>

nameless

Thanks for the quick response. I just tried both and nothing is showing now

<body>';
<table align="center">
  <tr>
    <td>



echo '</div>';
        echo '
        </td>
       </tr>
     </table>
   </body>
</html>';
}

Skate, Snow, and Surf - SF Boarders - Bringing San Francisco Bay Area boarders together.

kurotenshi

Quote from: nameless on April 15, 2005, 07:59:02 PM
Thanks for the quick response. I just tried both and nothing is showing now

<body>';
<table align="center">
  <tr>
    <td>


Replace that to:

<body>
<table align="center">
  <tr>
    <td>';



nameless

Thanks for the fast responses but everything is aligned but the board is still not centered on the page. Any ideas?

Skate, Snow, and Surf - SF Boarders - Bringing San Francisco Bay Area boarders together.

kurotenshi

Hmmh... I try by my self it too and not work... Darn.
I don't know what won't work *confused*  :-[ ???

nameless

I'm freaking lost too, I removed the width entry and now it's in the center.

body
{
        background-color: #BAE3F8;
        background-image: url(images/aloha-bamboo.jpg);
        margin: 0px;
        padding: 0px;
}


Where do I change the width value if I removed it?

Skate, Snow, and Surf - SF Boarders - Bringing San Francisco Bay Area boarders together.

kurotenshi

Try add it in <div> or <table> tag ie

<div width="760px" class="whatever">
<table width="760px" class="whatever">

I'm not sure will that work, but still can try :)

nameless

Nope, I tried that. I am not sure why it's not changing. THis is where I am at. What I am trying to do is put the board in between those bamboo pieces. I was able to get the board by setting it to 720 pixels but nothing else is moving. The bg for the bamboo is 760 pixels wide.






Skate, Snow, and Surf - SF Boarders - Bringing San Francisco Bay Area boarders together.

kurotenshi

Look Hendrix theme index.template.php and stylesheet. It has also made like that. It may help you a lot.

xyxis_fahim

#10
For my index theme..i added


 
Search for 

<div class="tborder" ', $context['browser']['needs_size_fix']


And right above it added--


<div align="center">

        <table class="forum-width" border="0" cellpadding="0" cellspacing="0">

        <tr>

        <td width="90%" align="left" valign="top">



Advertisement: