Log in

View Full Version : Customize CSS menu to select the cell



devtolu
09-17-2009, 05:07 PM
Hi all , i have used the menu on a website i am building but when i click a link and go to the page i cant know the page i am on, i need help so that when i click on a link and i get to the page i need the cell for the page am in to be highlighted like the hover effect to show that am on that page.

thanks.

simcomedia
09-17-2009, 09:40 PM
Do you mean you need the menu to show the 'active' page you're on?

davelf
09-18-2009, 02:13 AM
<!--
a1a2a7 : grey
19b3ff : blue
-->
<style>
a:visited
{
color:#a1a2a7;
text-decoration:none;
}
a:link
{
color:#a1a2a7;
text-decoration:none;
}
a:hover
{
color:#19b3ff;
font-weight:bold;
}
a:active
{
color:#19b3ff;
text-decoration:none;
}
</style>


good luck...

devtolu
09-18-2009, 07:34 AM
yes i need the menu to show me the active page am on

simcomedia
09-18-2009, 03:42 PM
You can use davelf's example code which displays a different color of the hyperlink for the active page. Plus, you could also add a background to it as well.

a:active
{
color:#19b3ff;
text-decoration:none;
background-color: #000;
}

Which would make it stand out even more.

devtolu
09-18-2009, 04:51 PM
I tried it but it did not work , where do i include it in the css i copied and pasted below.


.jqueryslidemenu{
font: bold 12px Verdana;
background: #414141;
width: 100%;
}

.jqueryslidemenu ul{
margin: 0;
padding: 0;
list-style-type: none;
}

/*Top level list items*/
.jqueryslidemenu ul li{
position: relative;
display: inline;
float: left;
}

/*Top level menu link items style*/
.jqueryslidemenu ul li a{
display: block;
background: #414141; /*background of tabs (default state)*/
color: white;
padding: 8px 10px;
border-right: 1px solid #778;
color: #2d2b2b;
text-decoration: none;
}

* html .jqueryslidemenu ul li a{ /*IE6 hack to get sub menu links to behave correctly*/
display: inline-block;
}

.jqueryslidemenu ul li a:link, .jqueryslidemenu ul li a:visited{
color: white;
}

.jqueryslidemenu ul li a:hover{
background: black; /*tab link background during hover state*/
color: white;
}

/*1st sub level menu*/
.jqueryslidemenu ul li ul{
position: absolute;
left: 0;
display: block;
visibility: hidden;
}

/*Sub level menu list items (undo style from Top level List Items)*/
.jqueryslidemenu ul li ul li{
display: list-item;
float: none;
}

/*All subsequent sub menu levels vertical offset after 1st level sub menu */
.jqueryslidemenu ul li ul li ul{
top: 0;
}

/* Sub level menu links style */
.jqueryslidemenu ul li ul li a{
font: normal 13px Verdana;
width: 160px; /*width of sub menus*/
padding: 5px;
margin: 0;
border-top-width: 0;
border-bottom: 1px solid gray;
}

.jqueryslidemenuz ul li ul li a:hover{ /*sub menus hover style*/
background: #eff9ff;
color: black;
}

/* ######### CSS classes applied to down and right arrow images ######### */

.downarrowclass{
position: absolute;
top: 12px;
right: 7px;
}

.rightarrowclass{
position: absolute;
top: 6px;
right: 5px;
}

.mainnav:link {
font-family:Helvetica;
text-decoration: none;
font-size:11px;
font-weight:bold;
color:#ffffff;
}
.mainnav:visited {
font-family:Helvetica;
text-decoration: none;
color:#ffffff;
font-size:11px;
font-weight:bold;
}
.mainnav:hover {
font-family:Helvetica;
color:#CCCCCC;
font-size:11px;
}
.mainnav:active {
font-family:Helvetica;
font-size:11px;
text-decoration: none;
color:#FFFFFF;
font-weight:bold;
background-color: #000;
}

simcomedia
09-18-2009, 08:51 PM
You need to insert this:

.jqueryslidemenu ul li a:active{
background: black; /*tab link background during active state*/
color: white;// change the font color to what you want
}

after this:

.jqueryslidemenu ul li a:hover{
background: black; /*tab link background during hover state*/
color: white;
}

davelf
09-19-2009, 04:50 AM
the code that i gave you before, will show the effect when you use the tag <a>.
for example:
http://www.dynamicdrive.com/forums/attachment.php?attachmentid=2876&stc=1&d=1253335687

you will see how the link work.

i give two example:
the first example, if the link color that you want same all over the page.
the second example, if the link color that you want have multiple color in one page.

davelf
09-19-2009, 10:23 AM
really sorry, i misunderstood your question.

The code that i give is for general :active,a:hover,a:link, and a:visited.

i don't really sure this will work, in your code. Because as far as i see in your css, there's js include.

try add, this:



a:active
{
color:#19b3ff; /* font */
text-decoration:none;
background-color:#19b3ff; /* background */
}