SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru
    Join Date
    Feb 2006
    Location
    Chepstow, South Wales
    Posts
    906
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Trying to use a:active without much success

    I'm trying to stylise the link that has been clicked in a 3 level drop down menu, and have gone around in circles in honesty and I thought hang on i will use a:active and again for 1 its not working anyway, and then I thought that if they was to change their mind on a level and select another link then the 2 will be stylised rather than the current selection.

    This is the little project:

    http://www.accend4web.co.uk/whitehart/index.php

    And basically I have a:active running now and only when you click the link and hold does the font size increase which is what Im using at the moment to see the effect, it will be a little more subtle than that if I can get it working.

    CSS:
    Code:
    #Drop_down_wrapper ul > li a:link{
        color: #0099FF;
        font-size: 14px;
        font-weight: normal;
    }
    #Drop_down_wrapper ul li a:visited {
    	color: #0099FF; 
        font-size: 14px;
        font-weight: normal;   
    }          	
    #Drop_down_wrapper ul li a:hover {
    	color:#F09909;
        font-size: 14px;
        font-weight: normal;    
    }
    #Drop_down_wrapper ul li a:active {
    	color:#000;
        font-size: 140px;
        font-weight: normal;    
    }
    I'm not sure if this is the way, so any other suggestions will be great.

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,784
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    a:active is triggered either by moving the mouse over the element and holding down a mouse button or by giving the field the focus by tabbing to it from the keyboard and then holding down the enter key.

    Which of these two ways of triggering active - holding down a mouse button or holding down the enter key - isn't working for you?
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  3. #3
    SitePoint Guru
    Join Date
    Feb 2006
    Location
    Chepstow, South Wales
    Posts
    906
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi felgall,
    Both are working, and simply put it isnt the answer to my problem, so I'm back to the drawing board unfortunately.

    What I'm looking for essentially is a sort of breadcrum trail of coloured buttons as the user moves around the levels.

    So they can see their path from the first selction at level 1, to the second choice at level 2 and the third choice takes them to a new page, so that isnt a problem.

    Thanks for getting back to me though.

    Lee

  4. #4
    SitePoint Wizard bronze trophy PicnicTutorials's Avatar
    Join Date
    Dec 2007
    Location
    Carlsbad, California, United States
    Posts
    3,656
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by multichild View Post
    Hi felgall,
    Both are working, and simply put it isnt the answer to my problem, so I'm back to the drawing board unfortunately.

    What I'm looking for essentially is a sort of breadcrum trail of coloured buttons as the user moves around the levels.

    So they can see their path from the first selction at level 1, to the second choice at level 2 and the third choice takes them to a new page, so that isnt a problem.

    Thanks for getting back to me though.

    Lee
    It's the answer to what you asked IMO. If your looking for a breadcrumb then it helps to say that. Here is what I use...

    PHP Code:
    <p id="breadcrumb">
        <?php 
        $path 
    $_SERVER["PHP_SELF"];
        
    $parts explode('/',$path);
        if (
    count($parts) < 2)
        {
        echo(
    "home");
        }
        else
        {
        echo (
    "<a href=\"/\">home</a> &raquo; ");
        for (
    $i 1$i count($parts); $i++)
            {
            if (!
    strstr($parts[$i],"."))
                {
                echo(
    "<a href=\"");
                for (
    $j 0$j <= $i$j++) {echo $parts[$j]."/";};
                echo(
    "\">"str_replace('-'' '$parts[$i])."</a> &raquo; ");
                }
            else
                {
                    
    $str $parts[$i];
                
    $pos strrpos($str,".");
                
    $parts[$i] = substr($str0$pos);
                echo 
    str_replace('-'' '$parts[$i]);
                };
            };
        };  
        
    ?>
    </p>
    Just put that on every page. I used a include to do that. That should be all that is necessary unless I overlooked something I originally used.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •