Results 1 to 13 of 13

Thread: a:active not registering on navigation menu [SOLVED]

  1. #1
    User
    Join Date
    10-15-10.
    Posts
    279

    Default a:active not registering on navigation menu [SOLVED]

    doing ".mod_navigation a:active" and trying to create a solid color background w/white text... but it doesn't seem to want to change. a:link/visited/hover work fine but not a:active... anyone know why? thanks!

    ~Mecha

    P.S. Hope everyone in the states had a good Halloween weekend XD

  2. #2
    User
    Join Date
    06-19-09.
    Location
    Elbl?g, Poland
    Posts
    152

    Default Re: a:active not registering on navigation menu

    Can you provide a link to the site?
    Marcin

    http://www.contao.pl - Polish Support Site
    http://forum.contao.pl - Polish Contao community forum


    -----------------------
    Need custom template? Feel free to contact me by e-mail marcin@contao.pl

  3. #3
    User
    Join Date
    10-15-10.
    Posts
    279

    Default Re: a:active not registering on navigation menu

    Quote Originally Posted by qrczak
    Can you provide a link to the site?
    i don't have the site hosted, working out of a test box. =/

  4. #4
    User
    Join Date
    10-15-10.
    Posts
    279

    Default Re: a:active not registering on navigation menu

    Code:
    /* Nav Color */
    .mod_navigation a:link,
    .mod_navigation a:visited
    {
    	text-decoration:none;
    	color:#808080;
    }
    /* Nav Hover */
    .mod_navigation a:hover
    {
    	width:200px;
    	height:25px;
    	float:right;
    	margin-bottom:2px;
    	padding-top:1px;
    	background-color:#396585;
    	text-decoration:none;
    	color:#ffffff;
    }
    /* Mod Active Link */
    .mod_navigation a:active
    {
    	background-color:#808080;
    	color:#ffffff;
    All but the last entry works fine...

  5. #5
    Community-Moderator xchs's Avatar
    Join Date
    06-19-09.
    Posts
    1,287

    Default Re: a:active not registering on navigation menu

    Where you have placed the navigation module? Can you provide the relevant part of the generated HTML source code here? You can try to add the according ID selector to be more specific...

    Do you have already inspected the relevant source code with Firebug? That would be always a good idea...
    Contao Community Moderator
    → Support options

  6. #6
    Community-Moderator xchs's Avatar
    Join Date
    06-19-09.
    Posts
    1,287

    Default Re: a:active not registering on navigation menu

    Quote Originally Posted by mechaflash
    All but the last entry works fine...
    In the last rule there is no closing bracket.
    Contao Community Moderator
    → Support options

  7. #7
    User
    Join Date
    10-15-10.
    Posts
    279

    Default Re: a:active not registering on navigation menu

    found a solution... use ".mod_navigation span" instead of the ".mod_navigation a:active"... as "span" is what indicates the "active" link in the nav module... Ty Firebug XD

  8. #8
    Community-Moderator xchs's Avatar
    Join Date
    06-19-09.
    Posts
    1,287

    Default Re: a:active not registering on navigation menu

    Quote Originally Posted by mechaflash
    found a solution... use ".mod_navigation span" instead of the ".mod_navigation a:active"... as "span" is what indicates the "active" link in the nav module... Ty Firebug XD
    Ahh, you wanted to style the active menu item in your navigation.

    You can of course also write ".mod_navigation span.active { ... }" to select this specific "active" menu item (which obviously is no anchor element)
    Contao Community Moderator
    → Support options

  9. #9
    User
    Join Date
    10-15-10.
    Posts
    279

    Default Re: a:active not registering on navigation menu

    Quote Originally Posted by xchs
    Quote Originally Posted by mechaflash
    found a solution... use ".mod_navigation span" instead of the ".mod_navigation a:active"... as "span" is what indicates the "active" link in the nav module... Ty Firebug XD
    Ahh, you wanted to style the active menu item in your navigation.

    You can of course also write ".mod_navigation span.active { ... }" to select this specific "active" menu item (which obviously is no anchor element)
    What i don't understand is that I was using .mod_navigation a:active... which is supposed to target the current active link in the navigation module... but it wasn't working. After looking at the module coding via firebug, I did notice that within the module, the current active link is enclosed in <span> so I used that... BUT it should've worked either way. I wonder why it didn't... :?

  10. #10
    Community-Moderator xchs's Avatar
    Join Date
    06-19-09.
    Posts
    1,287

    Default Re: a:active not registering on navigation menu [SOLVED]

    As I said before: The current menu item is NO anchor element ("a"). You are always talking about active links, although you'd have to select the active menu item with the <span> HTML element.
    Contao Community Moderator
    → Support options

  11. #11
    User
    Join Date
    10-15-10.
    Posts
    279

    Default Re: a:active not registering on navigation menu [SOLVED]

    Okay I get it now... in the nav the anchor "a" doesn't exist, thus span or span.active must be used because span is the anchor for the active link in the navigation module... right? lol sorry I'm new to this if you can't tell =P

  12. #12
    User
    Join Date
    06-29-09.
    Posts
    271

    Default Re: a:active not registering on navigation menu [SOLVED]

    You could always change the template so the active link can also be an anchor.

  13. #13
    User
    Join Date
    10-15-10.
    Posts
    279

    Default Re: a:active not registering on navigation menu [SOLVED]

    Quote Originally Posted by Vera
    You could always change the template so the active link can also be an anchor.
    now that's just doing too much work vera :D

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
  •