Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Need help fixing top Nav. bar of website

Need help fixing top Nav. bar of website

Views: 3,844

Results 1 to 20 of 41
8 Mar 2011, 1:32 AM
#1
dontblink7 avatar

dontblink7

New Zenner

Join Date:
Jan 2011
Posts:
53
Plugin Contributions:
0

Need help fixing top Nav. bar of website

hi id like the search box and links in the top navigation bar of my website to be fixed to the webpage like the background image is:
background-repeat: x;
background-attachment: fixed;
background-position: center top;
background-clip: border-box;
how would i do tht to the" Home Log In Privacy Notice Shared "bar?

8 Mar 2011, 1:40 AM
#2
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,180
Plugin Contributions:
0

Re: Need help fixing top Nav. bar of website

A link to the site please so I can view in Firefox browser with the Add On called Firebug so I can edit on the fly..

8 Mar 2011, 1:50 AM
#3
gjh42 avatar

gjh42

Black Belt

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

Re: Need help fixing top Nav. bar of website

This sounds like the ez-pages header navbar. Your template may have different names, but in stock Zen Cart this will do what you ask (and hopefully what you want:)

#mainWrapper {position: relative; padding-top: 40px;}
#navEZPagesTop {position: fixed; width: 740px; top: 0; z-index: 100;}

8 Mar 2011, 2:47 AM
#4
dontblink7 avatar

dontblink7

New Zenner

Join Date:
Jan 2011
Posts:
53
Plugin Contributions:
0

Re: Need help fixing top Nav. bar of website

my website is here: http://www.budgetac.com

i tried to add background-attachment:fixed; and attachment:fixed; to the code:

#mainWrapper{
margin: 0;
font-family: verdana, arial, helvetica, sans-serif;
font-size: 85.5%;
color: #000000;
width:425px;
float: right;
text-align:center;
background-color: #e5edf5;
background-image: url(../images/header_bg.jpg);
background-repeat: x;
background-position: center top;}
#mainWrapperlower{background-color:#fffff

is that right , or is there something i'm missing?

8 Mar 2011, 3:19 AM
#5
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,180
Plugin Contributions:
0

Re: Need help fixing top Nav. bar of website

Don,
Explain in more detail, are you wanting the whole header to have the blue image color you designed??

8 Mar 2011, 3:30 AM
#6
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,180
Plugin Contributions:
0

Re: Need help fixing top Nav. bar of website

Don,
Also notice this are you trying to add an image to your background body around the site??

body {
background-attachment: fixed;
background-color: #E5EDF5;
background-image: url("http://www.budgetac.com/html/background34.jpg");
background-position: center top;
color: #000000;
font-family: verdana,arial,helvetica,sans-serif;
font-size: 65.5%;
margin: 0;

  1. Change the highlighted red above to this:
  1. background-image: url("../images/background34.jpg");
  1. and then use your FTP program to load background34.jpg to the correct patch
  1. includes/templates/zj_silver_wide/css/images
8 Mar 2011, 4:32 AM
#7
gjh42 avatar

gjh42

Black Belt

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

Re: Need help fixing top Nav. bar of website

Your template has some of the usual ez-page links in the top navbar, so it is not #navEZPagesTop but #navMainWrapper that you want to affect.

This will do it:

#navMainWrapper {position: fixed;}

though you will want some other styling as well; I don't know what you want it to look like.

8 Mar 2011, 3:12 PM
#8
dontblink7 avatar

dontblink7

New Zenner

Join Date:
Jan 2011
Posts:
53
Plugin Contributions:
0

Re: Need help fixing top Nav. bar of website

thanks, but now it's sitting to the right and the page is scrolling over it, how do i get tht fixed?
and yes i did have a background picture before but it didnt work out cause i had the wrong color so one day i'll probably redo it, so i just added a 4 to the name of the image but thx:)

8 Mar 2011, 3:21 PM
#9
dontblink7 avatar

dontblink7

New Zenner

Join Date:
Jan 2011
Posts:
53
Plugin Contributions:
0

Re: Need help fixing top Nav. bar of website

Guess i Should add that my code looks like this now:
#mainWrapper{
margin: 0;
font-family: verdana, arial, helvetica, sans-serif;
font-size: 85.5%;
color: #000000;
width:425px;
float: left;
text-align:center;
position: fixed;
background-color: #e5edf5;
background-image: url(../images/header_bg.jpg);
background-repeat: x;
background-position: center top;}

8 Mar 2011, 4:04 PM
#10
gjh42 avatar

gjh42

Black Belt

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

Re: Need help fixing top Nav. bar of website

Your mainWrapper styling is essentially irrelevant for your question about the top navbar. If you are seeing other parts of the page cover the fixed navbar, then add the z-index property as described above.

#mainWrapper{ <--this is the rule for the whole page. did you think it was for the header navbar?
margin: 0;
font-family: verdana, arial, helvetica, sans-serif;
font-size: 85.5%;
color: #000000;
width:425px; <-- this is wrong for mainWrapper
float: left; <--you do not want this except in very specific styling circumstances
text-align:center;
position: fixed; <--this is probably not good for you, and doesn't affect the top nav
background-color: #e5edf5;
background-image: url(../images/header_bg.jpg);
background-repeat: x; <--should be repeat-x
background-position: center top;}

8 Mar 2011, 5:38 PM
#11
dontblink7 avatar

dontblink7

New Zenner

Join Date:
Jan 2011
Posts:
53
Plugin Contributions:
0

Re: Need help fixing top Nav. bar of website

ok youre saying tht

#mainWrapper <--this is the rule for the whole page...

but when i change any of this:

margin: 0;
font-family: verdana, arial, helvetica, sans-serif;
font-size: 85.5%;
color: #000000;
width:425px; <-- this is wrong for mainWrapper
float: left; <--you do not want this except in very specific styling circumstances
text-align:center;
position: fixed; <--this is probably not good for you, and doesn't affect the top nav
background-color: #e5edf5;
background-image: url(../images/header_bg.jpg);
background-repeat: x; <--should be repeat-x
background-position: center top;}

it changes the blue bar on top the page, the size, the color, the image, everything like tht, and when i change this:

#navEZPagesTop{background-color:#abbbd3;background-image:url(../images/tile_back.gif);font-size:0.95em;font-weight:700;margin:0;padding:0.5em;}

It doesn't do anything at all as far as i can see.

now if i change this:

#mainWrapperlower{background-color:#ffffff;text-align:left;width:1000px;vertical-align:top;border-bottom:2px inset #9a9a9a;border-left:2px inset #9a9a9a;border-right:2px inset #9a9a9a;padding-top:10px;margin:auto;}

i change the width of the template, the background color, border, etc.

so yes, it does look to me like the: #mainWrapper{....etc, is for the search bar header, is tht mixed up?

8 Mar 2011, 6:06 PM
#12
gjh42 avatar

gjh42

Black Belt

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

Re: Need help fixing top Nav. bar of website

As I said in post 7, #navMainWrapper is the actual container for your navbar - #navEZPagesTop is for a different menu which your template is not using.

#mainWrapper controls the entire site (including the top nav), and is like using a shotgun to kill a fly.

...Just looked at source, and you do have #mainWrapper controlling just the header nav. That means there is an error in the files (probably tpl_header.php) with an extra </div> which terminates the mainWrapper too early. It is supposed to enclose the whole site, and if it doesn't, the site will be harder to style properly.

8 Mar 2011, 6:16 PM
#13
gjh42 avatar

gjh42

Black Belt

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

Re: Need help fixing top Nav. bar of website

You have this```

<!--eof-navigation display--> <div id="log_in_header"> <form name="loginheader" action="https://www.budg...

...

<div class="buttonRow back important"><a href="https://www.budgetac.com/index.php?main_page=create_account">Create Account</a></div> <div class="buttonRow back important"><a href="https://www.budgetac.com/index.php?main_page=password_forgotten">Forgotten Your Password?</a></div> </form> <br class="clearBoth" /> </div> </div></div> <!--bof-branding display--> <div id="logoWrapper"> ```Edit tpl_header.php to remove the </div> in red and your site should come back together.
8 Mar 2011, 6:22 PM
#14
gjh42 avatar

gjh42

Black Belt

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

Re: Need help fixing top Nav. bar of website

That is a really screwy template... it appears that someone changed the name of #contentMainWrapper to #mainWrapperLower... it will take some investigating to see how they actually intended the structure to work.

8 Mar 2011, 6:24 PM
#15
dontblink7 avatar

dontblink7

New Zenner

Join Date:
Jan 2011
Posts:
53
Plugin Contributions:
0

Re: Need help fixing top Nav. bar of website

would that error show up in Debug Error-Logging Utility?

8 Mar 2011, 6:35 PM
#16
gjh42 avatar

gjh42

Black Belt

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

Re: Need help fixing top Nav. bar of website

OK... it appears that #mainWrapperLower encloses #contentMainWrapperTop (the stock element name tweaked), while #mainWrapper is not in any sense a main wrapper and is misleadingly named. There is no main wrapper for the site. (Unless there is indeed a superfluous </div> as noted above - I can't scan the entire output and keep track of div tags.)
Validation doesn't show an "extra" </div> at the bottom of the page, but it does show some other serious errors:
http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.budgetac.com%2F

You apparently pasted some HTML into a file with its auto-generated <html><head> etc. tags, which is not allowed.

It would not show in the PHP error logs, because these are HTML errors.

8 Mar 2011, 6:45 PM
#17
dontblink7 avatar

dontblink7

New Zenner

Join Date:
Jan 2011
Posts:
53
Plugin Contributions:
0

Re: Need help fixing top Nav. bar of website

ok, thx, is there any way to tell me where these errors are located? or i just have to find them?

8 Mar 2011, 6:53 PM
#18
gjh42 avatar

gjh42

Black Belt

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

Re: Need help fixing top Nav. bar of website

You apparently used a program called EditLive to make content. If you do something like that, you need to modify the result to be content for your page instead of a complete standalone page.

<div id="indexDefaultMainContent" class="content"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="http://editlive.com//sites/all/themes/editlive/demo/demo.css" type="text/css" />
<meta name="generator" content="EditLive! 7.5.1.39" />
<meta http-equiv="Content-Type" content="text/html; charset=iso8859_1" />
</head>

<body dir="ltr">
```All the doctype and head info needs to go away, as do the <body> tags. Put the style rules from the referenced demo.css stylesheet into your own stylesheet.css.
8 Mar 2011, 7:03 PM
#19
dontblink7 avatar

dontblink7

New Zenner

Join Date:
Jan 2011
Posts:
53
Plugin Contributions:
0

Re: Need help fixing top Nav. bar of website

ok iv'e erased the extra </div> tag and the website seems to have went normal, the #mainwapper seems to control the page, as u said, can u say where u found tht code at? cause i don't have Editlive on my computer i only use coda.

8 Mar 2011, 7:07 PM
#20
gjh42 avatar

gjh42

Black Belt

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

Re: Need help fixing top Nav. bar of website

indexDefaultMainContent

This is where define_main_page.php is output. Look at that (in plaintext mode) and you should see the extra <head> etc. tags.