HTML Help Forum Index HTML Help
Please Search for the answer to your question before asking it! Thanks.
 

CSS with HTML links
Post a Reply to this Topic Ask a New Question
Click here to go to the original topic
       HTML Help Forum Index -> SSI
View previous topic :: View next topic  
Author Message
RichieW13



Joined: 23 Aug 2005
Posts: 51

Posted: Tue Aug 23, 2005 3:26 pm     CSS with HTML links  

Is there any way to create a css that does HTML links?

For example, at the bottom of each of my pages, I want to have a link to every other page on my site. Is there a way that instead of putting a hard link on every page, I can put a reference to the css so that if a link changes, I only have to change it one time?

Does this make sense?


Corey Bryant



Joined: 15 May 2004
Posts: 8428
Location: Castle Pines North, CO USA

Posted: Wed Aug 24, 2005 4:05 am      

If you have given your div a name like footer:
Code: div.footer a:link, div.footer a:visited
{
     color: #330099;
     font-size: 0.8em;
}
div.footer a:hover, div.footer a:active
{
     color: #990000;
     text-decoration: none;
}
This will apply the classes to the links inside a div named footer.

For a little more information check out Pseudo-Classes
MissingDividends



Joined: 16 Aug 2005
Posts: 25

Posted: Thu Aug 25, 2005 7:23 am      

I think what you want is a dynamic webpage. If I understand what you are saying, you want the same footer on the bottom of evey page, but you want to be able to edit it just once to change it.

The easiest way to do that would be to change your pages to php (it isn't as hard as it might sound, just change the extensions), and add:
Code:
<?php
include ('footer.html');
?>

to the bottom of your page.

Create a file called footer.html that has the links in it, and you should be good to go.


There are other ways to do it (like shtml) but I never bothered to learn enogh to explain it to someone.
Corey Bryant



Joined: 15 May 2004
Posts: 8428
Location: Castle Pines North, CO USA

Posted: Thu Aug 25, 2005 7:30 am      

You're right - I misread it - I thought he was looking for a CSS solution to something since it was in the CSS topic area.

You can use an include file, like PHP if your server supports it. SHTML is the same basically as well as ASP. Of course, you would have to rename your pages (like index.html to something like index.shtml, index.phtm, index.php, index.asp, etc) to be parsed correctly.

For ASP, it would be something like:
Code: <!--#include file="includes/header.asp" -->
SSI:
Code: <!--#include file="includes/header.txt" -->
Of course, it also depends on the name of the file etc. You can have Apache parse all HTML as SHTML or PHP, but this places a lot more load on the server and can slow your site down as well.
RichieW13



Joined: 23 Aug 2005
Posts: 51

Posted: Thu Aug 25, 2005 8:13 am      

MissingDividends wrote: I think what you want is a dynamic webpage. If I understand what you are saying, you want the same footer on the bottom of evey page, but you want to be able to edit it just once to change it.

Yes, this is what I was looking for.

Quote:
Create a file called footer.html that has the links in it, and you should be good to go.

So I guess it turns out I'm in the wrong forum for this topic now, but how would I list the links in the footer.html file? Do I format them in the file? I want the links to all be on the bottom row of the footer. Or does it get formatted on the php page?
Corey Bryant



Joined: 15 May 2004
Posts: 8428
Location: Castle Pines North, CO USA

Posted: Thu Aug 25, 2005 8:18 am      

You basically create something like:
Code: <a href="/compare.asp">Compare Plans</a> : <a href="/canadian_rates.asp">Canadian Plans</a> : 
<a href="/international_rates.asp">International Rates</a> : <a href="/live/">Live Demos</a> :
<a href="/toll-free/features/fax_mail.asp">Fax Services</a> :
<a href="/toll-free/features/weblink/default.asp">WebLink</a> <br>
<a href="/distributors.asp">Become a Reseller</a> : <a href="/800_plans/solutions/">Business Solutions</a> : <a href="/contact/">
Contact Us</a> : <a href="/support/">Support Documents</a>
And then you can use your div / table to format it. You do not need the <head> / <body> since that will be pulled from your other file
RichieW13



Joined: 23 Aug 2005
Posts: 51

Posted: Thu Aug 25, 2005 8:22 am      

I'll give it a shot, thanks!
RichieW13



Joined: 23 Aug 2005
Posts: 51

Posted: Thu Aug 25, 2005 9:36 am      

I did it. That was easy. Thanks a bunch guys.

www.vrafan.com
Corey Bryant



Joined: 15 May 2004
Posts: 8428
Location: Castle Pines North, CO USA

Posted: Thu Aug 25, 2005 9:57 am      

Good luck with the site!
 
 
HOSTING / DESIGN
MAKE MONEY

       HTML Help Forum Index -> SSI
Page 1 of 1


Powered by phpBB Search Engine Indexer
Powered by phpBB 2.0.19 © 2001, 2002 phpBB Group