News:

Wondering if this will always be free?  See why free is better.

Main Menu

center the header :S

Started by Pyrokan, February 26, 2005, 03:02:35 PM

Previous topic - Next topic

Pyrokan

well, I started modifying the default theme to do my own theme, then, I've resized the header, the middle and the footer to 85% of width, and now I've centered the middle and the footer adding align="center" in the table tag, but when I try to do it with header nothing happens :S

how I can center the header in index.template.php?

// Because of the way width/padding are calculated, we have to tell Internet Explorer 4 and 5 that the content should be 100% wide. (or else it will assume about 108%!)
echo '
<div id="headerarea" style="padding: 12px 30px 4px 30px;', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' width: 100%;' : '', '">';

// The logo and the three info boxes.
echo '
<table cellspacing="0" cellpadding="0" border="0" width="85%">
<tr>
<td colspan="2" valign="bottom" style="padding: 5px; white-space: nowrap;">';

A.M.A

adding align="center" should do the trick .. could I see the first part of index.template.php till the code you have posted.
Really sorry .. real life is demanding my full attention .. will be back soon hopefully :)

vizcares

Hi I'm a newbee to this SMF and so forth I doreally like the layout, but I'm having some problems with centering the header.

Anyone who can help me doing this

My forum is on www.vizcares.com/foro [nofollow]


This is the code from the index.template.php file

Thanks in advance


// The logo and the three info boxes.
echo '
<table cellspacing="0" cellpadding="0" border="0" align="center" width="100%" style="position: relative;">
<tr>
<td colspan="2" valign="bottom" style="padding: 5px; white-space: nowrap;">';

// This part is the logo and forum name.  You should be able to change this to whatever you want...
echo '


<a  href="http://www.vizcares.com"><img width="85%" align="center" src="Themes/fondo_vizcares_foro.jpg" border="0"  alt="Pincha aquí para volver a la página del Vízcares">









</td>

bloc

Try to insert a align="center" in the <td colspan="2" valign="bottom" part.

vizcares

Ok, that did it, thanks a lot

It works with a screen resolution of 1024, but when I have a screen resolution of 800x600 I have the header to the right ???

Can you help me with this little bug???

bloc

I need to see it..do you have a link?

vizcares


bloc

Its because the newsbox "push" it out..its not really rightaligned, just looks that way -  because you have a scrollbar. But normally it should not behave like this..have you changed much in the theme?

vizcares

I haven't changed anything, just removed the part with the SMF logo and placed mine

bloc

Try removing the "white-space: nowrap" in the <td> before the <img> tag and remove the "width="85%" in the img tag. I think those 2 things create a scrollbar on the page.

vizcares

Thanks that helped a lot, but I still continue with the scroll-bar???

bloc

yeah..that is in fact because the image is 800px , but the forum also have some padding on the sides..so 800(from the image) + 40(or something) from the forum = 840-850. And that makes of course a scrollbar on 800x600 display. I would reduce the image to 700 in width and then see how it looks.

vizcares

Ok, that did it, a thousand thanks :D

Advertisement: