3rd Css/xhtml

Discussion in 'GR Classic Archive' started by Wonderboy, Sep 20, 2006.

  1. Wonderboy

    Wonderboy Well-Known Member

    Posts:
    1,347
    Likes Received:
    0
    Joined:
    May 19, 2005
    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.
     
  2. Xero3009

    Xero3009 Well-Known Member

    Age:
    34
    Posts:
    200
    Likes Received:
    0
    Joined:
    Apr 3, 2005
    Location:
    South Carolina
    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)
     
  3. Wonderboy

    Wonderboy Well-Known Member

    Posts:
    1,347
    Likes Received:
    0
    Joined:
    May 19, 2005
    Thanks for that, but is there anyway to do it without using lists ?

    C&C on site please ;)
     
  4. Sly.

    Sly. Well-Known Member

    Posts:
    1,622
    Likes Received:
    0
    Joined:
    Apr 5, 2006
    Nice coding :D
     
  5. Wonderboy

    Wonderboy Well-Known Member

    Posts:
    1,347
    Likes Received:
    0
    Joined:
    May 19, 2005
    bump
     
  6. Biw999

    Biw999 Well-Known Member

    Posts:
    62
    Likes Received:
    0
    Joined:
    May 2, 2005
    nice coding man
     
  7. Xero3009

    Xero3009 Well-Known Member

    Age:
    34
    Posts:
    200
    Likes Received:
    0
    Joined:
    Apr 3, 2005
    Location:
    South Carolina
  8. Wonderboy

    Wonderboy Well-Known Member

    Posts:
    1,347
    Likes Received:
    0
    Joined:
    May 19, 2005
    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
     
  9. Wonderboy

    Wonderboy Well-Known Member

    Posts:
    1,347
    Likes Received:
    0
    Joined:
    May 19, 2005
  10. Xero3009

    Xero3009 Well-Known Member

    Age:
    34
    Posts:
    200
    Likes Received:
    0
    Joined:
    Apr 3, 2005
    Location:
    South Carolina
    you add it in your <a> tag :P

    and you don't have to use the exact code ALA gives you, that is like an example
     
  11. Wonderboy

    Wonderboy Well-Known Member

    Posts:
    1,347
    Likes Received:
    0
    Joined:
    May 19, 2005
    It's fixed and working as it should :P
     

Share This Page