Log in

View Full Version : Menu assistance



garyr2548
04-30-2007, 02:18 AM
Ok, I have used the glossy menu from the dynamic drive page on my site and I love it. I have taught myself quite a bit of css over the past 4 months but am completely stumped by this so here is my question:

Is it possible to have my menu code in one file similar to that of the css file. I am trying to figure out a way that I can change the menu in one place and have it reflect on all of the pages that I have. I just dont really know how to go about that. I am not sure what I need but let me know if I need to post any of my code and I will be glad to.

If you would like to check out my site it is: http://www.policeunitytourviii.org

Thanks in advance for any help that is provided!

Gary


I went ahead and copied my stylesheet and listed it below. Like I said, I am self taught so if you see any glaring errors or improvements, please let me know!


h1 { font-family: Arial, serif; text-align: center; font-size: 14pt; color: black; font-weight: bold; }
h2 { font-family: Arial; font-size: 10pt; color: gray; font-weight: bold; }
h3 { font-family: Arial, serif; text-align: center; font-size: 7pt; color: gray; }
p { font-family: Arial; font-size: 10pt; color: gray;}
h4 { font-family: Arial, serif; font-size: 10pt; color: gray; font-style: italic; }
h5 { font-family: Arial, serif; text-align: center; font-size: 10pt; color: red; font-weight: bold; }
img {border:none;}

img.displayed {
display: block;
margin-left: auto;
margin-right: auto }

hr {margin-top:5px; width:60%; height:0px; }

.glossymenu{
list-style-type: none;
margin: 5px 0;
padding: 0;
width: 120px;
border: 1px solid #9A9A9A;
border-bottom-width: 0;
}

.glossymenu li a{
background: white url(glossyback.gif) repeat-x bottom left;
font: bold 13px "Lucida Grande", "Trebuchet MS", Verdana, Helvetica, sans-serif;
color: white;
display: block;
width: auto;
padding: 3px 0;
padding-left: 10px;
text-decoration: none;

}


* html .glossymenu li a{ /*IE only. Actual menu width minus left padding of A element (10px) */
width: 120px;
}

.glossymenu li a:visited, .glossymenu li a:active{
color: white;
}

.glossymenu li a:hover{
background-image: url(glossyback2.gif);
}


body {
font-family:arial,helvetica,sans-serif;
font-size:12px;
}
#wrapper {
width:900px;
margin:0px auto;
border:1px solid #bbb;
padding:10px;
}
#header {
border:1px solid #bbb;
height:197px;
padding:10px;
}
#top {
border:1px solid #bbb;
text-align: center;
font-family: Arial, serif; font-size: 10pt; color: gray; font-style: italic;
width:900px;
height: 17px;
margin-top:10px;
}
#content {
margin-top:10px;
padding-bottom:10px;
}
/* applies to all divs within the content div */
#content div {
padding:10px;
border:1px solid #bbb;
float:left;
}
#content-left {

width:125px;
}
#content-main {
margin-left:10px;
width:489px;
}

#content-right {
margin-left:10px;
width:200px;
}
#footer {
float:left;
text-align: center;
margin-top:10px;
margin-bottom:10px;
padding:10px;
border:1px solid #bbb;
width:878px;
}
#bottom {
clear:both;
text-align:right;
}

boogyman
04-30-2007, 02:37 AM
whenever you are posting code like that please use the [c.ode] and [c.ode] tags as they are specially formatted for this type of thing.

and it is possible to include your menu script into all of your pages. to link your css file you use


<link type="text/css" rel="stylesheet" href="host/path.css" />

and you can put your menu script into a file, then link it using a php include command; and all of your pages will have that heading.

garyr2548
04-30-2007, 06:12 AM
Well, thanks for the help, however I just got done researching what you told me using the include command and its clear as mud. So i guess I'll try to learn more about this and will give it a try. early tries seem to get me nowhere, but ill see what i can do. if there are any other ideas out there i'll all ears! thanks for taking the time to post!

Gary

boogyman
04-30-2007, 02:04 PM
<?php include("somefile.ext") ?>


the extension can really be anything you want, but it should really depend on the type of file. if there are any other php commands then the extension should be .php regular coding - .html styling - .css etcetc... if you need any other help don't be afraid to ask.

also, you need to be sure that your server supports php, or it wont matter how well your coding is done

Veronica
04-30-2007, 03:56 PM
If you have a hosting company, you need to contact them and ask if they support any kind of server side scripting, such as PHP, server side includes, etc. Also, if there's anything special you need to do to make them work.

If you can't use server side scripting, you could bring the navigation in with a javascript array. I really wouldn't recommend that, though, since anyone with javascript turned off won't see any navigation (not a good thing). You could also use iframes, one with the navigation, one with the content. But that would change the look of your page, which isn't a good thing either.

Why do you want the navigation in one file? Will it be changing often? The site doesn't seem so big that it would be hard to manage otherwise.

garyr2548
04-30-2007, 08:33 PM
Well, to be honest with you, I have no reason. I like to simplify things so I thought that would be a good one. Really, I plat to make a major structure change in the next moth or so, so once that is set, I really dont anticipate adding anything new or changing anything. I think my next hurdle will be using that css form from DD. I will start messing with it soon and will probably be back! Thanks again to all that posted!

boogyman
04-30-2007, 08:36 PM
css form? i didnt know we had any, but if you need any help feel free to email me or hit me up on messenger and ill help yah as best I can