Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

CSS for drop down menu

Featured Replies

hey,

 

Trying to change the black text in this drop down menu to white: My link

 

Has to be very easy to do I know, I dont understand the CSS fully, got it from a tutorial. I've tried changing the colour in parts of the CSS to see if it what I'm looking for but no joy, I added

#Header #nav li a  {color: #ffffff; }

but this hasn't worked, can anyone help me out?

 

cheers :)

Here's your culprit:

#Header #nav li:hover ul.sub li a {
display:block;
font-size:11px;
height:18px;
width:108px;
line-height:18px;
text-indent:5px;
color:#000;
text-decoration:none;
border:1px solid #0984ba;
}

 

change to color:#fff;

  • Author

Hey Guezala, I actually for got to attach my CSS code, what CSS file is that coming from?

 

This is the CSS I though the menu was pulling from: menu.css

 

#Header #nav {padding:0; margin:0; list-style:none; height:38px; position:relative; z-index:500; font-family:arial, verdana, sans-serif;}
#Header #nav li.top {display:block; float:left; height:38px; padding: 0px 18px 0px 0px;}
#Header #nav li a.top_link {display:block; float:left; height:35px; line-height:33px; color:#ffffff; text-decoration:none; font-size:11px; font-weight:normal; cursor:pointer;}
#Header #nav li a.top_link span {float:left; display:block; height:35px;}
#Header #nav li a.top_link span.down {float:left; display:block; height:35px; color:#ffffff;}


#Header #nav li:hover a.top_link 
{color:#ffffff;}
#Header #nav li:hover a.top_link span {}
#Header #nav li:hover a.top_link span.down {}

/* Default list styling */

#Header #nav li:hover {position:relative; z-index:200;}

#Header #nav li:hover ul.sub
{left:1px; top:38px; background: #0984ba; padding:3px; border:1px solid #0984ba; white-space:nowrap; width:110px; height:auto; z-index:300;}
#Header #nav li:hover ul.sub li
{display:block; height:20px; position:relative; float:left; width:110px; font-weight:normal;}
#Header #nav li:hover ul.sub li a
{display:block; font-size:11px; height:18px; width:108px; line-height:18px; text-indent:5px; color:#000; text-decoration:none;border:1px solid #0984ba;}

#Header #nav li:hover ul.sub li a:hover 
{background:#00638f; color:#fff; border-color:#fff;}



#Header #nav li:hover li:hover ul,
#Header #nav li:hover li:hover li:hover ul,
#Header #nav li:hover li:hover li:hover li:hover ul,
#Header #nav li:hover li:hover li:hover li:hover li:hover ul
{left:110px; top:-4px; background: #bbd37e; padding:3px; border:1px solid #5c731e; white-space:nowrap; width:110px; z-index:400; height:auto;}

#Header #nav ul, 
#Header #nav li:hover ul ul,
#Header #nav li:hover li:hover ul ul,
#Header #nav li:hover li:hover li:hover ul ul,
#Header #nav li:hover li:hover li:hover li:hover ul ul
{position:absolute; left:-9999px; top:-9999px; width:0; height:0; margin:0; padding:0; list-style:none;}

 

Should I have the files hidden somehow, whats best practice?

 

 

Thanks :)

It's from you menu.css file. I think there are ways to 'hide' your css, but I don't personally. If someone wants to use your code they will find a way (ducks down from impending fire!)

 

Hope this helps :D

Sometimes when i have having issues trying to find css declarations. i.e in your case the black text i just open the css file and Ctrl + F the search for #000 or #000000 or black.

Or use firefox with the firebug addon. Then you just hover over the html code and it shades over which elements it refers too. You can also edit the css in it to see what works:D

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.