Forums / Templates, Stylesheets, Page Layout / centering vertically the menu bar text

centering vertically the menu bar text

Views: 975

Results 1 to 7 of 7
4 Oct 2011, 3:31 PM
#1
tcjay avatar

tcjay

Zen Follower

Join Date:
Jul 2010
Location:
Boston
Posts:
139
Plugin Contributions:
0

centering vertically the menu bar text

I can not move the text in the menu bar navigation so it is centered vertically in the bar.

This is the styling:

#navEZPagesTop {
text-align:center;
font-size: 1.2em;
font-weight: bold;
margin: - 0 0 0em;
border-left:1px solid #663300;
border-right:1px solid #663300;
height:32px;
background-image: url(../images/navEZPagesTopbackground.jpg);

}

Can someone please advice:

http://www.stitchboutiqueboston.com

TIA Tom :cool:

4 Oct 2011, 5:09 PM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: centering vertically the menu bar text

You need to put your padding-top in #navEZPagesTop instead of #navEZPagesTop a.

You realize that those links jump around as the visitor navigates since you placed the breadcrumbs inside #navEZPagesTop ?

4 Oct 2011, 7:42 PM
#3
tcjay avatar

tcjay

Zen Follower

Join Date:
Jul 2010
Location:
Boston
Posts:
139
Plugin Contributions:
0

Re: centering vertically the menu bar text

I have made the change as well as decreasing the height by the amount of the padding.

I realize that the links move around based on the width of the bread crumbs. I was not sure where the code should be placed. Where would you suggest I place it?

Tom :cool:

4 Oct 2011, 8:02 PM
#4
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: centering vertically the menu bar text

I'd leave it where it is in a stock Zencart installation - in the maincontent area, below the headerwrapper. I'd guess you or someone moved it in includes/templates/YOUR_TEMPLATE/common/tpl_main_page.php

5 Oct 2011, 7:39 PM
#5
tcjay avatar

tcjay

Zen Follower

Join Date:
Jul 2010
Location:
Boston
Posts:
139
Plugin Contributions:
0

Re: centering vertically the menu bar text

stevesh:

You need to put your padding-top in #navEZPagesTop instead of #navEZPagesTop a.

You realize that those links jump around as the visitor navigates since you placed the breadcrumbs inside #navEZPagesTop ?

How do I prevent the EXpage navigation menu from jumping around when the breadcrumbs are long?

THis is the code from the ezpages_bar_header template. :cool:

include(DIR_WS_MODULES . zen_get_module_directory('ezpages_bar_header.php'));
?>

<div id="navEZPagesTop"> <!-- bof breadcrumb --> <?php if (DEFINE_BREADCRUMB_STATUS == '1' || (DEFINE_BREADCRUMB_STATUS == '2' && !$this_is_home_page) ) { ?> <div id="navBreadCrumb"><?php echo $breadcrumb->trail(BREAD_CRUMBS_SEPARATOR); ?></div> <?php } ?> <!-- eof breadcrumb --> <?php if (sizeof($var_linksList) >= 1) { ?> <?php for ($i=1, $n=sizeof($var_linksList); $i<=$n; $i++) { ?>

<a href="<?php echo $var_linksList[$i]['link']; ?>"><?php echo $var_linksList[$i]['name']; ?></a><?php echo ($i < $n ? EZPAGES_SEPARATOR_HEADER : '') . "\n"; ?>

<?php } // end FOR loop ?> </div> <?php } ?>
13 Oct 2011, 6:55 PM
#6
tcjay avatar

tcjay

Zen Follower

Join Date:
Jul 2010
Location:
Boston
Posts:
139
Plugin Contributions:
0

Re: centering vertically the menu bar text

What I did was create a container box and class id called navEZPagesTopContainerBox and then set the right margin.

<div id="navEZPagesTopContainerBox">

<?php if (sizeof($var_linksList) >= 1) { ?> <?php for ($i=1, $n=sizeof($var_linksList); $i<=$n; $i++) { ?>

<a href="<?php echo $var_linksList[$i]['link']; ?>"><?php echo $var_linksList[$i]['name']; ?></a><?php echo ($i < $n ? EZPAGES_SEPARATOR_HEADER : '') . "\n"; ?>

<?php } // end FOR loop ?>

</div>

#navEZPagesTopContainerBox {
margin-right:20px;
}

13 Oct 2011, 7:18 PM
#7
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: centering vertically the menu bar text

You didn't need any extra div to achieve the right spacing.

stylesheet.css (line 155)

#navEZPagesTop {
    background-image: url("../images/navEZPagesTopbackground.jpg");
    border-left: 1px solid #663300;
    border-right: 1px solid #663300;
    font-size: 1.2em;
    font-weight: bold;
    height: 25px;
    padding-top: 0.5em;
    text-align: right;
    width: 100%;
}
```Change the items in red like this:```
#navEZPagesTop {
    background-image: url("../images/navEZPagesTopbackground.jpg");
    border-left: 1px solid #663300;
    border-right: 1px solid #663300;
    font-size: 1.2em;
    font-weight: bold;
    height: 25px;
    padding: 0.5em 2em 0 0;
    text-align: right;
    width: auto;
}