Jump to content
Stef's Coding Community
Sign in to follow this  
Guest Cashster09

background color

Recommended Posts

Guest Cashster09

Hi again,

Im sure this one is simple but it's just not working.

 

I have a menu and when i hover over a tab its light blue background. When i get to that page i would like it to stay that color on that tab.

 

I have this code in my style sheet

 

li.current {

background-color: #AED3D9;

color: #FF0000;

}

 

and then i have class="current" in my menu

Home

About Us

Services/Staff

Online Coupons

Dry Cleaning Articles

FAQ

Contact Us

 

thanks in advance

Share this post


Link to post
Share on other sites

Can you post a link, please, so we can see the balance of the page and css. There may be something else interfering with the code someplace. A link works best for us to check the full page. Saves us having to download or create a page.

Share this post


Link to post
Share on other sites

change the CSS to

.current a {
   background-color: #AED3D9;
   color: #FF0000;
} 

but aside from that, you have all kinds of coding errors, beginning with using HTML doctype and XHTML closing tags.

Share this post


Link to post
Share on other sites
Guest Cashster09

yes i noticed the doctype on the article page i should change that...

which doctype should i use?

 

I also changed it to a background instead of the blue color and it works great, but i want the text color to be black not white. I changed it in the styles.css but its still white.

 

here is my code.

 

.current a {

background: #AED3D9 url( selectedMenu.jpg?z=16168 ) repeat-x;

color: #000000;

}

Edited by Cashster09

Share this post


Link to post
Share on other sites

In your CSS you should put

#nav1 li a.current {

background: #AED3D9 url( selectedMenu.jpg?z=16168 ) repeat-x;

color: #000000;

}

 

and in your html page

  • Dry Cleaning Articles
  • Edited by virtual

    Share this post


    Link to post
    Share on other sites
    Guest Cashster09

    Is a list intentionally different where you need to put the "class" tag?

     

    Usually i can put

    .whatever {

    color: somecolor;

    }

     

    and it would work, but for the list navigation it didnt.....but when i placed it in the tag it was perfect like you said...

     

    thanks

    Edited by Cashster09

    Share this post


    Link to post
    Share on other sites

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.
    Note: Your post will require moderator approval before it will be visible.

    Guest
    Reply to this topic...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    Loading...
    Sign in to follow this  

    ×
    ×
    • Create New...