Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 08-08-2004, 04:08 AM   #1
Member (8 bit)
 
Join Date: Jun 2004
Location: South Bucks, England
Posts: 160
Send a message via AIM to longrawker Send a message via MSN to longrawker
Putting in a Nav. bar with CSS

Hey.

I was curious, is there a way to put in a image-mapped .jpg to use as a Nav bar, with CSS? For example, could you put the code which would do that in an external style sheet, and then link the page you want the Nav bar on, to the style sheet? Or do you just have to copy/paste the HTML onto every page of your site?

I have also noticed that some CSS doesnt work on certan browsers, AOL being one of them. Would the Nav bar just not show up then?

Thanks.
longrawker is offline   Reply With Quote
Old 08-08-2004, 01:16 PM   #2
Member (7 bit)
 
Join Date: Mar 2004
Location: Sacramento, CA
Posts: 86
Send a message via AIM to mrdeeye
i am not really sure if this is what your looking for, but i have been developing a website for my moms work which is all html/css. And my navbar is all done with css

this is the html for it
HTML Code:
<div id="nav">
<a href="/index.htm">Home</a>  
<a href="/link1.htm">Link</a>
<a href="/link2.htm">Link 2</a>
<a href="/link3.htm">Link 3</a>
<a href="/link4.htm">Link 4</a>
<a href="/link5.htm">Link5</a> 
<a href="/link6.htm">Link6</a>
and this would be your css


Code:
#nav{
display: block;
background-color: #c00000;
position: absolute;
top: 180px;
left: 10px;
width: 120;
border: 1px solid #000000;
text-align: center;
font-size: 12px;
font-weight: bold;
}
and if you wanna see the finished product go to http://www.svfca.org .....hope that helps
mrdeeye is offline   Reply With Quote
Old 08-08-2004, 01:18 PM   #3
Member (8 bit)
 
neouser99's Avatar
 
Join Date: Jun 2004
Location: Kansas City, MO
Posts: 157
Send a message via AIM to neouser99
AOL doesn't work because it uses Internet Explorer, which doesn't conform to todays standards, particularly W3C.

No, you can't use a .css to do what you are asking. .css are reserved just for styles and formatting. What you can do is a server side include (ssi). Or, use php to include another file, but that would require the webserver has php. I would just recommend using ssi to include with a small one line piece of code on each page...

<--#include blahblah.shtml--> or something like that.

just google server side includes, that will tell you how to use it.

-neo
neouser99 is offline   Reply With Quote
Old 08-08-2004, 03:25 PM   #4
Staff
Premium Member
 
mairving's Avatar
 
Join Date: Jul 1999
Location: Arlington, TN
Posts: 5,538
Server Side Includes are about as dated as using frames. I personally wouldn't recommend them. It would be pretty easy to do using PHP with PHP's include function.
__________________

Want to Make $$$$ with your Computer? No Risk! Simply press shift-4 four times in a row
mairving is offline   Reply With Quote
Old 08-08-2004, 03:40 PM   #5
Member (8 bit)
 
Join Date: Jun 2004
Location: South Bucks, England
Posts: 160
Send a message via AIM to longrawker Send a message via MSN to longrawker
So i could use the include function to display an image-mapped .jpg?
longrawker is offline   Reply With Quote
Old 08-08-2004, 03:42 PM   #6
PCMech: Saving Lives
 
Join Date: Apr 2004
Location: England, the United Kingdom
Posts: 1,839
What languages does your server support? If it supports PHP use what mairving said, to use a server side include you need a server that supports it, this normally comes bundled/along with a language.
__________________
WhatsThisBoxFor? is offline   Reply With Quote
Old 08-08-2004, 03:54 PM   #7
Member (8 bit)
 
Join Date: Jun 2004
Location: South Bucks, England
Posts: 160
Send a message via AIM to longrawker Send a message via MSN to longrawker
The server supports PHP, so it would work, right? But how do i standardize it for all of my pages. Just include the same code? Then i'm no better off than i was copy/pasting all of the html.
longrawker is offline   Reply With Quote
Old 08-08-2004, 03:58 PM   #8
PCMech: Saving Lives
 
Join Date: Apr 2004
Location: England, the United Kingdom
Posts: 1,839
It would work, don't know PHP, but I assume it includes a file, and you copy and paste the entire thing, but if you change the file with the CSS the output to all the pages change. If you just copy the CSS to each page if you change it you will have to copy it to all the pages again. At least thats how it would work using the languages I know.
WhatsThisBoxFor? is offline   Reply With Quote
Old 08-08-2004, 08:54 PM   #9
Member (8 bit)
 
neouser99's Avatar
 
Join Date: Jun 2004
Location: Kansas City, MO
Posts: 157
Send a message via AIM to neouser99
it works just the way you would think an include works.

you have document a.php. within document b.php you have this code

Code:
include( "path/to/a.php" );
that line calls up a.php, and pastes everything taht is within a.php and puts it right there, the exact same thing as copy and paste, but you do it with that line instead of the 50 or 1000 lines that you have in a.php.

-neo
neouser99 is offline   Reply With Quote
Old 08-08-2004, 11:16 PM   #10
Barefoot on the Moon!
Staff
Premium Member
 
Force Flow's Avatar
 
Join Date: Aug 2002
Location: Northeastern USA
Posts: 13,385
Would something like hotspots work out for you?
__________________
There are two secrets to staying young, being happy, and achieving success. You have to laugh and find humor every day, and you have to have a dream.
Force Flow is offline   Reply With Quote
Old 08-11-2004, 06:34 PM   #11
Member (9 bit)
 
Join Date: Oct 2003
Location: Minnesota, USA
Posts: 382
Send a message via AIM to MrAustin
Just put your navigation HTML in a seperate file (here named "nav.inc") like so:

HTML Code:
<a href="/index.htm">Home</a>  
<a href="/sacvalley/about/about_us.htm">About Us</a>
<a href="/sacvalley/membership/membership.htm">Membership</a>
<a href="/sacvalley/events/events.htm">Events</a>
<a href="/sacvalley/newsletter/newsletter.htm">Newsletter</a>
<a href="/sacvalley/links/links.htm">Links</a> 
<a href="/forum">Forum</a>
And at the top of each page, put the following:

PHP Code:
<?php include("includes/nav.inc"); ?>
While yes, you might as well copy/paste the whole thing, the portion of this to grasp is that you can now edit ONE FILE and have the changes reflected wherever the navigation include was used.
MrAustin is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 06:51 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2