I have a site thewilliamsfamilytree.com.

If you go to the site. You see a bunch of text links on the left side.

My question is
how do i change or control everything in that menu from one CSS file? I would like to use that menu on every page of my site and edit all text and links at from one place.

Recommended Answers

All 3 Replies

Here's a quick example. Assuming that you have this external style sheet in your directory default.css -- and the rules would be:

ul { list-style-type: none; line-height: 140%; margin-left: 1em; width: 100%; }
li { display: inline; margin: 0.8em 0 0 0.8em; padding-left: 0.5em; line-height: 140%; width: auto; }
li a:link { display: block; text-decoration: none; border-bottom: thin dashed; padding-bottom: 0.3em; } /* now try to reference it with your (x)HTML document's. */

Use the link element to reference it on your pages. Simply insert the code below between the head section of your (x)HTML document's...

<link rel="stylesheet" type="text/css" href="default.css" media="all" />

hope this will help you for now...

im sorry im not understanding

1. Save all the CSS in that menu, into a file, and call it menu.css.
2. Add this code to all of the files which have the menu in it:
<link rel="stylesheet" type="text/css" href="menu.css" media="all" />
Now all of the pages with that code in it, use that stylesheet and when you change that stylesheet all of the pages will change

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.