This is my 3rd template using CSS and XHTML It's a [wip] so some c&c would be nice http://wonderboy.mythicx.com/css2 Merged Post: Code: #navigation a:link, #navigation a:visited { color:#CCC; text-decoration: none; padding-left:2em; padding-right:2em; padding-top:.5em; padding-bottom:.5em; height:2.5em; line-height:2.5em; display: block; background:#993300; } #navigation a:hover, #navigation a:active { color:#CCC; padding-left:2em; padding-right:2em; padding-top:.5em; padding-bottom:.5em; background:#660000; height:2.5em; display: block; line-height:2.5em; } I have this code, which means when a link is clicked it is an active link and should becasue "#CCC" so why when i am on the page does it change back to the default. I want it do do this. When hover over it, it should appear #660000 and when clicked on, and on that page it should appread #660000. So that you know what page you are on. And normal background color of #993000. Now thats what i thought i had done, but it doesn't seem to be working.
so you are wanting to make the link stay the hovered style when you are on that page? there are 2 ways to do this, you can keep it doing it manually or you can do it with PHP for the php tutuorial: http://www.alistapart.com/articles/keepingcurrent/ as for the manual way, it's the same thing exceptyou put the class in manually and you change it out manually, ect. (the manual way doesn't work if you plan on using <php include() ?> to include the navigation (which would be smart)
I'm still having a little trouble with it. I don't really want to use Php, just stick to CSS atm. That link you sent me said to add this code Code: HTML <div id="navigation"> [list] [*][url="#"]Page One[/url] <li id="currentpage">[url="#"]Page Two[/url] [*][url="#"]Page Three[/url] [*][url="#"]Page Four[/url] [/list] </div> CSS #navigation ul { list-style: none; margin: 0; padding: 0; } #navigation li { background: #ccc; border-left: 1px solid #999; float: left; margin: 0; padding: 0; } #navigation a { color: #666; font-weight: bold; padding: 5px 10px; text-decoration: none; } #navigation a:hover { color: #333; } #navigation #currentpage a { background: #fff; color: #333; } But i can't seem to get it to work. It has <li id=> i'm not using lists, so where does my id tag go ? I'll try again later tonight, but if someone could confirm that it is the right code that would be great. Thanks
you add it in your <a> tag and you don't have to use the exact code ALA gives you, that is like an example