Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Nov 2002
    Location
    Bristol, UK
    Posts
    932
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question What is the correct CSS notation for this?

    I have a menu. Each menu item has the class .menu_item

    Now, I want to set the styles for the links that are the menu items. Surely I do this:

    .menu_item a:active {}

    ..because this works:

    #sidemenu p {}

    which I apply to all p tags in the sidemenu.

    However the link styles do not work. I am applying them in the following order:

    Code:
    .menu_item {
    	font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif;
    	font-size: 12px;
    	color: #000000;
    	text-align: left;
    	margin: 0px 0px 4px 0px;
    	padding: 4px;
    	width: 100%;
    	background-color: #FFFFFF;
    	border: 0px none;
    }
    .menu_item a:link {
    	text-decoration: none;
    }
    .menu_item a:visited {
    	text-decoration: none;
    	color: #333333;
    }
    .menu_item a:hover {
    	text-decoration: none;
    	background-color: #F6F6F6;
    	border: 1px solid #CCCCCC;
    }
    .menu_item a:active {
    	text-decoration: none;
    	color: #330099;
    }
    And an example menu item is this:

    <a class="menu_item" href="#">MAIN MENU</a>

    ...so, why doesn;t it work?

    ::] krycek [::
    ithium | SOAPI | SDP | PTPScript manual
    "ithium is a non-profit webhost, which is pretty much unique. The mission of ithium is to provide free hosting resources for worthwhile and needy non-profit projects, which otherwise may not be able to obtain such facilities. The money from commercial customers goes to maintain ithium's servers and further development."

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Montreal, Canada
    Posts
    644
    Thanks
    0
    Thanked 0 Times in 0 Posts
    try just
    .menu_item:hover {

    drop the "a" on each one.

  • #3
    Regular Coder
    Join Date
    Nov 2002
    Location
    Bristol, UK
    Posts
    932
    Thanks
    0
    Thanked 0 Times in 0 Posts
    DAMN!

    ...it works now. TO think it was that simple!

    Thanks goose!

    ::] krycek [::
    ithium | SOAPI | SDP | PTPScript manual
    "ithium is a non-profit webhost, which is pretty much unique. The mission of ithium is to provide free hosting resources for worthwhile and needy non-profit projects, which otherwise may not be able to obtain such facilities. The money from commercial customers goes to maintain ithium's servers and further development."


  •  

    Posting Permissions

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