tags:

views:

1384

answers:

3

How can I accomplish this?

My CSS:

.MainMenu
{
    position: absolute;
    top:135px;
    left:15px;    
    background-color: #033E6B;
    color:White;
    border-style:double;
    border-color:White;
}

.MainMenu ul
{
    list-style-type:none;
    padding-left:3px;
    padding-right:3px;
}

My UserControl Code:

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MainMenu.ascx.cs" Inherits="LoCompro.UserControls.MainMenu" %>
<ul>
    <li><asp:LinkButton ID="LinkButton4" runat="server">Inicio</asp:LinkButton></li>
    <li><asp:LinkButton ID="LinkButton1" runat="server">Navegar Por Categoria</asp:LinkButton></li>
    <li><asp:LinkButton ID="LinkButton2" runat="server">Navegar Por Marca</asp:LinkButton></li>
    <li><asp:LinkButton ID="LinkButton3" runat="server">Buscar</asp:LinkButton></li>
</ul>

And my MasterPage:

<div class="MainMenu">
            <uc2:MainMenu ID="MainMenu1" runat="server" />
        </div>

My intention is go modify the way my links appear. I want them to be white color, turn yellow on hover and never change even if they click on it/have visited before.

I don't know how to work with LinkButtons, today's my first time. :)

Thanks guys!

A: 

Give the link buttons a CssClass="nameofclass" which is a property of the linkbutton

In your css then:

.nameofclass
{

}
.nameofclass a
{

}
klabranche
A: 

You can use the CssClass property of a LinkButton to add a css class to them.

<asp:LinkButton ID="LinkButton1" CssClass="buttonClass" runat="sever">

Then just make a css class "buttonClass" in your css file.

.buttonClass
{
}
Matthew Talbert
How can I change the color of my LinkButton?
Sergio Tapia
+5  A: 

This should be pretty close.

.MainMenu a { 
  color: #FFF;
}

.MainMenu a:active 
{

}

.MainMenu a:visited 
{

}

.MainMenu a:hover { 
  color:#FFFF00;
}
Andy Gaskell
You beat me to editing that into my response. :)
klabranche
Man, I freaking love this site. Everyone is so knowledgable. I hope one day I can reach this level. :) Thank you!
Sergio Tapia