Results 1 to 8 of 8
  1. #1
    Join Date
    Mar 2006
    Location
    Reading, Berkshire, U.K
    Posts
    38
    Plugin Contributions
    0

    Default How to center header image?

    Hi, I was wondering if someone could tell me how to centre my header image on my website www.linuxdisks.co.uk?

    Thanks,

    Ian

  2. #2
    kelvyn Guest

    Default Re: How to center header image?

    Being another Reading person, I'll try and help!

    OK, in stylesheet_original.css, add the following additional definition just below the the top "main" item:

    .header {
    text-align: center;
    }

    And you're done!

    See the "useful" section of my sig: using the "developers toolkit" extension to Firefox, finding stuff like this is easy!

  3. #3
    Join Date
    Jun 2003
    Posts
    33,721
    Plugin Contributions
    0

    Default Re: How to center header image?

    Since you used the tabled template, Kelvyn's solution will not work.

    Open your CUSTOM_TEMPLATE/common/tpl_header.php

    Find this table:

    Code:
            <table border="0" width="100%" cellspacing="0" cellpadding="0" class="header">
              <tr><!-- All HEADER_ definitions in the columns below are defined in includes/languages/english.php //-->
                <td valign="middle" height="<?php echo HEADER_LOGO_HEIGHT; ?>" width="<?php echo HEADER_LOGO_WIDTH; ?>">
    <?php echo '<a href="' . zen_href_link(FILENAME_DEFAULT) . '">' . zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT) . '</a>'; ?>
                </td>
                <td align="center" valign="top">
    <?php
                  if (HEADER_SALES_TEXT != '') {
                    echo HEADER_SALES_TEXT;
                  }
                  if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2)) {
                    if ($banner->RecordCount() > 0) {
                      echo zen_display_banner('static', $banner);
                    }
                  }
    ?>
                </td>
              </tr>
            </table>
    Remove the right hand table cell to end up with this:

    Code:
            <table border="0" width="100%" cellspacing="0" cellpadding="0" class="header">
              <tr><!-- All HEADER_ definitions in the columns below are defined in includes/languages/english.php //-->
                <td valign="middle" height="<?php echo HEADER_LOGO_HEIGHT; ?>" width="<?php echo HEADER_LOGO_WIDTH; ?>">
    <?php echo '<a href="' . zen_href_link(FILENAME_DEFAULT) . '">' . zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT) . '</a>'; ?>
                </td>
              </tr>
            </table>

  4. #4
    kelvyn Guest

    Default Re: How to center header image?

    What...ever! Did you actually do it on his site?

    Try it. It works.

  5. #5
    Join Date
    Jun 2003
    Posts
    33,721
    Plugin Contributions
    0

    Default Re: How to center header image?

    Trust me Kelvyn- I have been doing that header for 3 years - if you do not remove the empty cell you will end up slight off center in certain browsers.

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: How to center header image?

    Note: you should also upgrade to the current v1.3.0.1 ...

    Be sure to backup both your site and your database before performing an upgrade ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  7. #7
    kelvyn Guest

    Default Re: How to center header image?

    OK, sorry if I came across as harsh, but I applied the modified stylesheet both in IE7 and FF1.5 and it looked centre to me, and as the CSS tweak was the easiest way for a newbie, I used that.

  8. #8
    kelvyn Guest

    Default IE7 and Firefox behaving differently

    I now noticed that in Firefox it looks OK, but in IE7, the yellow bars are missing!

    See http://www.funnfrolic.co.uk/party-store/

    I wonder why my CSS generated yellow bars are missing in IE? Any ideas gratefully received!

    Thanks

 

 

Similar Threads

  1. I am at my wits end!!! (and I'm just trying to center a freakin header image)
    By nappyjim in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 22 Jun 2009, 08:45 PM
  2. Adding an image for the header and footer of center column
    By smoke133 in forum Templates, Stylesheets, Page Layout
    Replies: 14
    Last Post: 14 Sep 2008, 08:45 PM
  3. Center Logo in Header Vertically & Wrap Text Around Image
    By chava in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 6 Oct 2007, 04:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg