Val Dobson wrote: > Is there a CSS method to hide the current page link in a navigation > list? ie: if you're on the "widgets" page, you don't get the "See our > crazy widgets!" link in the menu.
You can do this only if you have some way of distinguishing the current page link from other elements in terms of CSS. This normally means it needs to have a suitable class (or id) attribute. CSS does not "know" anything about a link pointing to the page itself. In theory you could use attribute selectors that select elements e.g. on the basis of the href attribute value. But there's no way in CSS to couple this with the idea of the URL of the page itself. > I'm responsible for looking after a static HTML site that has had > more and more pages added to it over the years, and changing the > navigation on each page is becoming a chore. > I know how to do includes, I'd just like to hide the current page > link.. Simple server-side includes won't help. You would need to generate the navigational elements in a manner that uses some distinguishing markup for the current page link. You might ask why not then remove that link instead of hiding it from the visual appearance, and that's a good question. If you cannot use any more advanced server-side techniques, then probably the best shot is to add a piece of JavaScript that traverses the links on the page and hides any link pointing to the page itself. Here, too, one might ask why not remove the link from the document tree instead of just hiding it via CSS. -- Yucca, http://www.cs.tut.fi/~jkorpela/ ______________________________________________________________________ css-discuss [cs...@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/