Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Center Logo in Header Vertically & Wrap Text Around Image

Center Logo in Header Vertically & Wrap Text Around Image

Locked

Views: 3,863

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
5 Oct 2007, 11:24 PM
#1
chava avatar

chava

New Zenner

Join Date:
Apr 2007
Posts:
40
Plugin Contributions:
0

Center Logo in Header Vertically & Wrap Text Around Image

I followed the suggestions to center my logo in the header of my site by setting out separately:
#logo {
text-align:center;
}

This centered the logo horizontally just fine, but my header area increased in height, creating extra space on the bottom. I then added:

vertical-align:middle;
to the above and it brought the logo down a little from the top, but still left additional space at the bottom.

Is there something else I need to change. The extra height is fine, I guess, would just like to center it vertically.

Also, I tried wrapping text around my credit card image on the main page, positioning the logo on the right. It worked, but the text does not start at the same level as the top of the image. Is there something coded into zencart causing this? I notice that if you click on a product to go to the product listing page, the small photo upper left also has the text spaced down from the top. Any idea where I can change this to get the text in line with the top of these images.

I used this text (edited for posting here) on my main page to wrap the text around image:

<p><img src="<http://www.antiquesbycharla.com/XXXXX/XXXXXXXXX/visa_mc_discover.gif>" alt="Credit Card Logos" align="right" width="176" height="35" hspace="25"/></p> <p>For your shopping convenience, we accept Discover, Visa, MasterCard, checks or money orders.</p>

http://www.antiquesbycharla.com
Thanks for any help.

6 Oct 2007, 12:37 AM
#2
rufus avatar

rufus

Zen Follower

Join Date:
Sep 2007
Posts:
214
Plugin Contributions:
0

Re: Center Logo in Header Vertically & Wrap Text Around Image

Hi Chava,

Option One
If you want to remove the space below the your logo try removing

<div id="taglineWrapper"></div> <br class="clearBoth" />

both of which are right above the <!--eof-branding display--> you can also remove the vertical-align: middle; that you added
***************

Option Two
If you like the gap (and down want to remove it completely, after doing the above change your css as below

#logo {
         text-align: center;
		 padding-top:10px;
		 padding-bottom:10px;
         }

***************

6 Oct 2007, 1:34 AM
#3
chava avatar

chava

New Zenner

Join Date:
Apr 2007
Posts:
40
Plugin Contributions:
0

Re: Center Logo in Header Vertically & Wrap Text Around Image

Thanks so much RuFus for the quick reply. I removed the vertical-align:middle and added the 10px padding to top & bottom. It did add the padding to the top and increased my header size vertically even more. So I need to apply the other fix you mentioned.

In My includes/templates/my custom template/common/tpl-header.php
(I am assuming this is the correct folder to change). You said to find:

<div id="taglineWrapper"></div>, but what I find doesn't have the </div> at the end.

I found this:
<!--bof-branding display-->
<div id="logoWrapper">
<div id="logo"><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT) . '</a>'; ?></div>
<div id="taglineWrapper">
<?php if (HEADER_SALES_TEXT != '') { ?>
<div id="tagline"><?php echo HEADER_SALES_TEXT;?></div>
<?php } ?>
<?php if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2)) { if ($banner->RecordCount() > 0) { ?>
<div id="bannerTwo" class="banners"><?php echo zen_display_banner('static', $banner);?></div>
<?php } } ?>
</div>
</div>
<br class="clearBoth"/>
<!--eof-branding display-->

Am I supposed to remove these two lines in red, even though the first doesn't have </div> at the end?
Thanks.

6 Oct 2007, 1:49 AM
#4
rufus avatar

rufus

Zen Follower

Join Date:
Sep 2007
Posts:
214
Plugin Contributions:
0

Re: Center Logo in Header Vertically & Wrap Text Around Image

Hi Chava,

You could actually (as you are not using this code) try removing everything in red below

<!--bof-branding display--> <div id="logoWrapper"> <div id="logo"><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT) . '</a>'; ?></div> <div id="taglineWrapper"> <?php if (HEADER_SALES_TEXT != '') { ?> <div id="tagline"><?php echo HEADER_SALES_TEXT;?></div> <?php } ?> <?php if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2)) { if ($banner->RecordCount() > 0) { ?> <div id="bannerTwo" class="banners"><?php echo zen_display_banner('static', $banner);?></div> <?php } } ?> </div></div> br class="clearBoth"/> <!--eof-branding display-->
6 Oct 2007, 2:11 AM
#5
rufus avatar

rufus

Zen Follower

Join Date:
Sep 2007
Posts:
214
Plugin Contributions:
0

Re: Center Logo in Header Vertically & Wrap Text Around Image

Your image alignment issue can be solved by changing your code to this:

<p><img src="http://www.antiquesbycharla.com/XXXX...c_discover.gif" alt="Credit Card Logos" align="right" width="176" height="35" />For your shopping convenience, we accept Discover, Visa, MasterCard, checks or money orders. </p>
6 Oct 2007, 2:40 AM
#6
chava avatar

chava

New Zenner

Join Date:
Apr 2007
Posts:
40
Plugin Contributions:
0

Re: Center Logo in Header Vertically & Wrap Text Around Image

Hi RuFuS
Awesome! Thanks so much! Removing all that text worked perfectly.

Regarding my 2nd problem, the reason I had hspace="25" is to put some space between the text and the logo horizontally. If I remove that, it snugs the text right up to the logo. I did remove it just to see the effect, and it didn't move the text up in line with the top of the image. I have it removed now and the effect is still the same. Am I missing something.

6 Oct 2007, 2:51 AM
#7
rufus avatar

rufus

Zen Follower

Join Date:
Sep 2007
Posts:
214
Plugin Contributions:
0

Re: Center Logo in Header Vertically & Wrap Text Around Image

Hi Chava,

The code for your second issue is slightly different, it not only removes the hspace (as it isn't needed) but places the image inside paragraph <p> tags.

I did quickly test this and it worked fine for me in Fireworks and IE?

:blink:

6 Oct 2007, 3:18 AM
#8
chava avatar

chava

New Zenner

Join Date:
Apr 2007
Posts:
40
Plugin Contributions:
0

Re: Center Logo in Header Vertically & Wrap Text Around Image

Thank you again RuFuS. I overlooked that I was suppose to remove one of the sets of <p> tags. Worked perfectly!:clap:

Thanks so much for your help. Now I can get on my way to finishing up my site and adding items.