CSS code to thin down width of navbar dropdown links?
ChancyRat
Registered Users Posts: 2,141 Major grins
I have a horizontal menu on the site, but the dropdown links to the subgalleries are too wide apart. I saw in another thread that someone used CSS code to fix this, but it was for the vertical accordion menu type. Either way I couldn't do CSS myself. Would someone post the code for the horizontal menu? Thanks.
0
Comments
You'll prob. want to play with the padding. Since you sent me your HTML source code I can actually see what your sub-menu navbar looks like. I assume when you say they're "too wide apart" you're not meaning their actual width but rather the space above and below each link?
The sub-links are going to adjust to the maximum size they need to be so that your text fits. SOme of your links are quite long (a lot of characters) so the sub-menu navbar will be fairly wide. I do see that there is some padding to the left/right of the links that could be reduced. The "padding" code above controls how much spacing there is. If all you want to do is reduce the spacing, get rid of all the other lines andl eave just the "padding" line.
In the padding command the 4 numbers are as follows:
padding:7px 32px 6px 11px;
top padding is 7px
right padding is 32px
bottom padding is 6px
left padding is 11px
Former SmugMug Product Team
aaron AT aaronmphotography DOT com
Website: http://www.aaronmphotography.com
My SmugMug CSS Customizations website: http://www.aaronmphotography.com/Customizations
Awesome and perfect, thank you sooo much.
How about:
- the fade-in effect I see here: http://www.brandolinoimaging.com/Info-Pages/Help-Pages/n-zvWvH
- transparency as opposed to or along with a background color? Example: http://www.rosscollins.smugmug.com/
I couldn't quite get the fade-in effect to work. I know it needs some kind of code like this, but I couldn't figure out which element to apply it to, to make it work
Transparent background color is easy: just look up the CSS command "rgba()".
rgba() takes 4 parameters: 3 RGB color values and a transparency value between 0.0 (completely transparent) and 1.0 (completely opaque).
Instead of using a color like #FFFFF you use the RGB value's (like 255, 255, 255).
So you might have a line that says "background-color: rgba(255, 255, 255, 0.4);"
Hope that helps.
Former SmugMug Product Team
aaron AT aaronmphotography DOT com
Website: http://www.aaronmphotography.com
My SmugMug CSS Customizations website: http://www.aaronmphotography.com/Customizations
And then the code you gave me:
I am not sure what to take out or change.
But it is not changing the colors in any way. The current test theme image is attached. I see I was able to change the major color of the links to a tan, but the hover color and borders of the outsides, remain grey. I cannot find anywhere that I change that color.
EDIT: I forgot I also need to make the whole drop-down menu transparent, cannot find that.
Above "border-bottom ..." add a "border" command:
I'm not sure on the transparent background.
Former SmugMug Product Team
aaron AT aaronmphotography DOT com
Website: http://www.aaronmphotography.com
My SmugMug CSS Customizations website: http://www.aaronmphotography.com/Customizations
This is not working and I may not have been clear on the problem. In the image I put yellow over part of the link the hand is hovering over. When hovered over, a link turns grey. I want to change that grey to something else. I cannot find code on the site that controls the hover color.
My Website index | My Blog
Sorry, I ignored the hover color and only addressed that you mentioned your border was grey. Do you want to leave the border grey or do you also want to change it? The above code will fix the border.
To change the background when the mouse hovers over it:
Former SmugMug Product Team
aaron AT aaronmphotography DOT com
Website: http://www.aaronmphotography.com
My SmugMug CSS Customizations website: http://www.aaronmphotography.com/Customizations
I don't think this will do what she wants -- she wants to change the background color not the text color
Former SmugMug Product Team
aaron AT aaronmphotography DOT com
Website: http://www.aaronmphotography.com
My SmugMug CSS Customizations website: http://www.aaronmphotography.com/Customizations
Hooray I am learning to communicate this lingo. Great. As for the transparency, I see two sites that have it so I know it can be done:
http://rosscollins.smugmug.com/
http://www.onbroadwaydancers.com/
In trying variations, what I've left out is that I want the background to be "seen" through the transparency.
All the tries so far yield a lighter or darker color. None of them bring the background into the hover.
Here is a line of code from another thread that I tried, to get transparency, but no matter what I do, I get either a revert to the grey (Is that the default of the theme???), or a default to the solid pale yellow that I input as a test for the rgba.
background-color: rgba(0, 0, 0, 0.9);
What is needed to make the hover colors (both the main menu dropdown list, and the hover color), different varieties of transparency to the background of the webpage. E.g., no color.
Sorry again my learning curve for terms.
http://www.dgrin.com/showthread.php?t=239876&highlight=transparency
Chancy,
I apologize for not being clear. The lingo you've used from the beginning was the correct lingo. I understand what you want, I've just not been able to figure out the code to do it. The rgba() command is the correct command to use. The problem is that there are multiple layers at work and I cannot seem to figure out which layer is causing the static/non-transparent background to be there.
OK, I take that back. I think I figured it out...
On that 2nd part, where it says "turn off the background color ..." you may already have some CSS for that ".yui3-menu-label". If you did, just delete the "background-color" line ... or set it to rgba(0,0,0, 0.0); to make it completely clear.
The first line above is where you set the actual color and transparency. For testing purposes I set it to really transparent (0.1).
Hope that helps.
Former SmugMug Product Team
aaron AT aaronmphotography DOT com
Website: http://www.aaronmphotography.com
My SmugMug CSS Customizations website: http://www.aaronmphotography.com/Customizations
And, I realized "be careful what you wish for", because I see in my test background right now, the code you just supplied makes for a non-good result.
Finally, there must be one bit of code missing because the hover color for the drop-down links now first hovers to grey and then to yellow, in the "fade transition". Before I added this recent code, it went from the pale tan, to yellow. (I might have removed the pale tan line?) Does this mean that you got the background transparency for the link itself but not for the hover-color?
Here is the total code I have that I think is relevant:
Thank you.
I don't know if this helps explain anything but this pesky grey background that seems to exist as a default in the theme, is also at the top Smugmug navbar. It has a default grey which now transitions to the pale yellow. So your code applied at a high level as well, not just my site navbar.
Also, this thread, your code in #15:
http://www.dgrin.com/showthread.php?t=241108
Contributed to making my sitemap links transparent.
http://www.dgrin.com/showthread.php?t=241108
/* Change the way the sub-menu bar looks */
.sm-page-layout-region-top .yui3-menu-item .yui3-menu-label {
padding: 5px 15px 4px 9px !important;
font-size: 14px;
background-color: rgba(0, 0, 0, 0.0);
}
/* Set the background transparency on the navbar */
.sm-page-widget-nav .sm-page-widget-nav-popover .yui3-menu,
.sm-page-widget-nav .sm-page-widget-nav-popover .yui3-menu-children {
background-color: rgba(68, 68, 68, 0.2);
}
However, I wonder if I can 1) get rid of the border lines (which give a box effect), change the background color for the drop down menu and 3) change the color for the links of the entire navbar?
Thanks
Three times I applied it:
Once for normal, another for rollover and the other one to stop the border around the entire drop down.
Torn between cycling and photography!
EDIT: Checked with smugmug, it is purposely done for pads and phones.
/* Bold the menu nav links in the HEADER */
.sm-page-layout-region-top .sm-page-widget-nav-toplink {
font-weight: 500;
}
/* Change the way the sub-menu bar looks */
.sm-page-layout-region-top .yui3-menu-item .yui3-menu-label {
padding: 5px 15px 4px 9px !important;
font-size: 16px;
background-color: rgba(0, 0, 0, 0.0);
}
/* Set the background transparency on the navbar */
.sm-page-widget-nav .sm-page-widget-nav-popover .yui3-menu,
.sm-page-widget-nav .sm-page-widget-nav-popover .yui3-menu-children {
background-color: rgba(68, 68, 68, 0.3);
}
/* Remove the border lines which give a box effect on the navbar */
.sm-page-widget-nav .sm-page-widget-nav-popover .yui3-menu,
.sm-page-widget-nav .sm-page-widget-nav-popover .yui3-menu-children {
border-style: none;
}
.sm-page-widget-nav .sm-page-widget-nav-popover.sm-page-widget-nav-sublinks-separator .yui3-menu .yui3-menu-label {
border-style: none;
}
.sm-page-widget-nav .sm-page-widget-nav-popover.sm-page-widget-nav-sublinks-separator .yui3-menu .yui3-menu-label:hover {
border-style: none;
}
Former SmugMug Product Team
aaron AT aaronmphotography DOT com
Website: http://www.aaronmphotography.com
My SmugMug CSS Customizations website: http://www.aaronmphotography.com/Customizations
I havnt had a chance to switch until now. Anyway Ive been trying to get my navbar to look better and used your code. It looks great but only works on my homepage. How can I get it to work on the rest of my site? I have the code in the Entire Site - Theme - CSS. Does it have to be somewhere else?
Thanks ......... Bob
Figured it out. I somehow had 2 themes with the same name in different places. Deleted 1 and navbar works on everything.