Results 1 to 7 of 7

Thread: Smooth Navigation Menu Styles

  1. #1
    Join Date
    Sep 2013
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Smooth Navigation Menu Styles

    1) Script Title: Smooth Navigation Menu

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...smoothmenu.htm

    3) Describe problem: I have a need to change the background color of one (and only one) sub-menu item. It seems it should be a simple matter but something is blocking me.

    I have entered the 'style' in the <li> element. Should this not work? Have I missed something in the css file that prohibits it? Here is the line: <li style="background-color: #008000;"><a href="#">Materials</a></li>

    BTW I really love this script and appreciate having it. I am using it on one site with complete satisfaction. This issue is for a new project ... it is important that the color of this one element be green.

    Thanks
    Jack

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,076
    Thanks
    44
    Thanked 3,216 Times in 3,178 Posts
    Blog Entries
    12

    Default

    Try adding the !important keyword:

    Code:
    <li style="background-color: #008000 !important;"><a href="#">Materials</a></li>
    If you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Sep 2013
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    John ... Thanks for the quick reply. The !important keyword didn't help.
    The site is not finished but you can see the operational menu in its current state at http://framemakers.us/AbsoWebdocs/home.htm ... The problem code is in an external file at http://framemakers.us/AbsoWebdocs/Su...les/exmenu.htm (line 33). Writing this, I recall not mentioning having changed the background color of the menu bar from default to #E0E0E0. (Line 3 in your ddsmootmenu.css ... no other changes there).

  4. #4
    Join Date
    Mar 2010
    Location
    Florida
    Posts
    381
    Thanks
    6
    Thanked 35 Times in 33 Posts

    Default

    Looking at your code and view that element i noticed it says this:
    Code:
    <li style="color: #008000 !important;"><a href="#">Materials</a></li>
    Doesn't it need to be this (for background-color):
    Code:
    <li style="background-color: #008000 !important;"><a href="#">Materials</a></li>
    -DW [Deadweight]
    Resolving your thread: First Post: => EDIT => Lower right: => GO ADVANCED => Top Advance Editor drop down: => PREFIX:Resolved

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    29,076
    Thanks
    44
    Thanked 3,216 Times in 3,178 Posts
    Blog Entries
    12

    Default

    That's right Crazykid69. And in this particular case, the li isn't the element whose background is being seen. It's the a tag's. So they would need to apply it to the a tag:

    Code:
    <li><a style="background-color: #008000 !important;" href="#">Materials</a></li>
    The important keyword is probably not needed:

    Code:
    <li><a style="background-color: #008000;" href="#">Materials</a></li>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. The Following User Says Thank You to jscheuer1 For This Useful Post:

    vbchjack (10-04-2013)

  7. #6
    Join Date
    Sep 2013
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Amazing what can be done when you get it right. I never would have thought to put it in the <a> tag ... and !important is not needed. Originally it was "background-color" in the <li> tag ... in desperation I was trying everything to see the effect and did not change it back. Thanks guys!

  8. #7
    Join Date
    Sep 2013
    Posts
    7
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default url problem

    An earlier post appears below. Note the references to urls. Google picks up on this and gives me error messages as these files no longer exist. Can these urls be deleted??? or somehow hidden???
    Thanks Jack



    Quote Originally Posted by vbchjack View Post
    John ... Thanks for the quick reply. The !important keyword didn't help.
    The site is not finished but you can see the operational menu in its current state at http://framemakers.us/AbsoWebdocs/home.htm ... The problem code is in an external file at http://framemakers.us/AbsoWebdocs/Su...les/exmenu.htm (line 33). Writing this, I recall not mentioning having changed the background color of the menu bar from default to #E0E0E0. (Line 3 in your ddsmootmenu.css ... no other changes there).

Similar Threads

  1. Smooth Navigation Menu
    By William Hill in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 07-05-2011, 10:55 PM
  2. Smooth Navigation Menu
    By stellating in forum Dynamic Drive scripts help
    Replies: 10
    Last Post: 07-29-2010, 04:18 AM
  3. Smooth Navigation Menu for IE 8
    By stellating in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 07-23-2010, 10:39 AM
  4. Smooth Navigation Menu...Not so Smooth
    By neogeekgirl in forum JavaScript
    Replies: 0
    Last Post: 02-25-2010, 03:56 PM
  5. smooth navigation menu
    By gauri_agr in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 12-04-2009, 03:09 PM

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
  •