CSS & links throughout - Post ID 1934

User 55304 Photo


Registered User
72 posts

Hi. I am fairly new to CSS but I would like to know how I can add and find a bit of css script that I can put in my index page that will allow me to change a link in a menu and have it change throughout the other pages within a website, the same with colours and fonts maybe. Can this be achieved and is it very hard as I am not too good with code. Thanks for any help.

Regards
Chris
User 355448 Photo


Ambassador
3,144 posts

Chris,

CSS is style. The idea here in a simple form is you can change the background of every page with a single change to your CSS. You can change the font you are using or the size or the color to evey page on your site all with a single change to your CSS. It may turn out to be more complicated than that since you can also override the main CSS with style in the code of each page.

HTML can be either style or content, but the trind is now to make HTML content. I don't think you can change a link with CSS, but there are ways to change a single file and have every page on your site change.

Personally, I use PHP for the parts of my pages that are the same throughout my sites. You can also do the same thing with Windows .ASP files.

As an example, I have a footer on each page that is the same footer on all pages. I use a single line of code on each page, and that loads a separate file with every part of the footer, including many anchors. The line of code I use is: <?php include($DOCUMENT_ROOT . "/include/footer.php"); ?>

Then my file located in my include folder named footer.php is loaded with a mail link for contacting me, links to other sections on my sites, and even images showing what software I am using.

If you are wanting to have a menu that you can change, CoffeeCup has a flash menu and (my favorite) a DHTML menu. With the DHTML menu, you can either insert the entire code in each page and then come back and change each page, or you can put the code in a separate file and again use a single line of code to call the menu. If you put that single line of code on each page, all you need to do is make one change to the menu code, and all pages will reflect that change.

If all this sounds complicated, that is likely because I am long winded. Just let us have more information about what you want to do, and we can help you get to that point.
User 55304 Photo


Registered User
72 posts

Many thanks for your reply. The php sounds perfect for adding the links and footers. Here is a link of a site I am creating. As you can see on the right hand side of the page you will see the links created with coffee cup flash menu builder. However when you click on a link you will see that the other template pages don’t have the links in yet. Please can you instruct me how to link to them as simple as possible? Bearing in mind I will maybe be adding links in the future as the site grows and therefore only want to change one file for links. Thank you for looking. http://www.ludlowflatcompetition.co.uk/

PS this is in the trial stage and the site is not yet complete
User 78330 Photo


Registered User
198 posts

Hey Chris. You live near me then :)

Not being able to see inside the .swf file used to create the buttons I presume you just need to link each button to the relevant page.

IE. For the flat details button just link it to flat-details.html

edit: few typos in the photo alts.

This Could Be You Kitchen
Dinning Room
User 355448 Photo


Ambassador
3,144 posts

As I mentioned, I don't use the flash menu that much. If you just put this code on each page in the location where you want the menu, it should appear:
<object style="WIDTH: 119px; HEIGHT: 233px;" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="CC1714572" align="middle">

<param name="movie" value="mymenu.swf"/>
<param name="quality" value="high"/>
<param name="scale" value="noscale"/>
<param name="salign" value="lt"/>
<param name="bgcolor" value="#ffffff"/>
<param name="wmode" value="transparent"/>
<embed style="WIDTH: 119px; HEIGHT: 233px;" src="mymenu.swf" quality="high" bgcolor="#ffffff" wmode="transparent" name="CoffeeCup" scale="noscale" salign="lt" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"/></object>

If you look at http://www.ludlowflatcompetition.co.uk/mymenu.swf you will see your menu on a blank page. Every location that you put the entry "NAVAGATION LINKS HERE" just replace that with the menu code. All the other parts of the menu are already in place.
User 55304 Photo


Registered User
72 posts

Many thanks for your help Billr, it is appreciated

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.