Navbar/Menu: add translucent background w/rounded corners to each link; text opaque
corpuzrob
Registered Users Posts: 77 Big grins
Hi Smuggers,
Here's my site: http://www.robcorpuz.com/
I'm using the Cosmo theme.
/* Nav bar borders */
/* Add a curved background to each link in the menu (nav) bar */
.sm-page-widget-nav-toplink, .sm-page-widget-nav-toplink:last-child {
background: #888eb2; !important;
opacity: 1;
border-radius: 100px;
padding: 7px 7px 7px 7px !important;
width: 93%;
margin-bottom: 10px !important;
}
/* Set the default navbar submenu background color */
.yui3-menu .yui3-menu-children .yui3-menu-item .yui3-menu-label {
background: #888eb2;
border-radius: 100px;
margin-top: 10px !important;
margin-bottom: 10px !important;
margin-left: 20px !important;
margin-right: 20px !important;
padding: 7px 7px 7px 7px !important;
}
/* Change the border color */
.yui3-menu .yui3-menu-children,
.sm-page-widget-nav .sm-page-widget-nav-popover.sm-page-widget-nav-sublinks-separator .yui3-menu .yui3-menu-label {
padding: 7px 7px 7px 7px;
}
/* Set the navbar submenu hover background color */
.yui3-menu .yui3-menu-children .yui3-menu-item .yui3-menu-label:hover {
background: #888eb2;
opacity: .5;
}
Thanks again! -Rob
Here's my site: http://www.robcorpuz.com/
I'm using the Cosmo theme.
- I'd like to add a translucent, colored background to each menu item in the nav-bar/menu and sub-menu, both for desktop view and for the collapsed mobile "menu." If it's not clear what I mean, you can look at the menu on my blog (http://blog.robcorpuz.com/), although the background is not translucent there (yet). I would like my smugmug site to have some visual design consistency with my wordpress.com blog and am using circles and rounded corners in the hope of doing this.
- I tried doing this already by googling and copying bits of code from others (I'll add the code I was using below) to try to do this, and while the top menu looked okay, I can't get the default grey rectangular background of the sub-menu to disappear, or at least fade.
- Also, I want to change the text to be left-justified, but when I did it the rounded backgrounds of the top-menu and sub-menu interfere with each other. I'd like to be able to move the sub-menu to the right.
- I'd also like to keep the little arrows (that signify additional sub-menus) to be inside the rounded backgrounds.
- On the mobile view, I'd like also to add the same translucent colored background with rounded corners to the whole menu (or at least the first, collapsed "menu") and reduce the width of the menu background.
- I'd also like to adjust the font color (both regular and hover) just of the nav-bar, without having to change my default text/accent colors.
- When I tried to adjust the opacity of the menu backgrounds, it faded the text as well. I'd like to keep the text opaque but be able to control the opacity of the backgrounds.
/* Nav bar borders */
/* Add a curved background to each link in the menu (nav) bar */
.sm-page-widget-nav-toplink, .sm-page-widget-nav-toplink:last-child {
background: #888eb2; !important;
opacity: 1;
border-radius: 100px;
padding: 7px 7px 7px 7px !important;
width: 93%;
margin-bottom: 10px !important;
}
/* Set the default navbar submenu background color */
.yui3-menu .yui3-menu-children .yui3-menu-item .yui3-menu-label {
background: #888eb2;
border-radius: 100px;
margin-top: 10px !important;
margin-bottom: 10px !important;
margin-left: 20px !important;
margin-right: 20px !important;
padding: 7px 7px 7px 7px !important;
}
/* Change the border color */
.yui3-menu .yui3-menu-children,
.sm-page-widget-nav .sm-page-widget-nav-popover.sm-page-widget-nav-sublinks-separator .yui3-menu .yui3-menu-label {
padding: 7px 7px 7px 7px;
}
/* Set the navbar submenu hover background color */
.yui3-menu .yui3-menu-children .yui3-menu-item .yui3-menu-label:hover {
background: #888eb2;
opacity: .5;
}
Thanks again! -Rob
0
Comments
SmugMug Hero & CSS Monkey
https://help.smugmug.com/get-started-with-customization-SkgwJ4rM
I also have changed the code since I added the post. Here's the relevant section:
/* Change the navbar fonts */
.sm-page-widget-nav-toplink, .yui3-menu-item .yui3-menu-label,
.sm-page-widget-nav-toplink > a {
color: #201864 !important;
}
/* Turn the navbar text a different color when the mouse hovers over it */
.sm-user-ui .sm-page-widget-nav-toplink a:hover {
color: #e3af01!important;
}
/*Adds Hover Transition Effect to Nav Bar*/
a {
-webkit-transition:color 0.15s ease-in;
-moz-transition:color 0.15s ease-in;
transition:color 0.15s ease-in;
}
.yui3-menu-children {
opacity: 0;
transition: opacity 0.15s ease-out;
}
.yui3-menu-open > .yui3-menu-children {
opacity: 1;
}
/* Nav bar borders */
/* Add a curved background to each link in the menu (nav) bar */
.sm-page-widget-nav-toplink, .sm-page-widget-nav-toplink:last-child {
background: #888eb2; !important;
opacity: 1;
border-radius: 100px;
padding: 7px 7px 7px 7px !important;
width: 93%;
margin-bottom: 10px !important;
}
/* Set the default navbar submenu background color */
.yui3-menu .yui3-menu-children .yui3-menu-item .yui3-menu-label {
background: #888eb2;
border-radius: 100px;
margin-top: 10px !important;
margin-bottom: 10px !important;
margin-left: 20px !important;
margin-right: 20px !important;
padding: 7px 7px 7px 7px !important;
}
/* Change the border color */
.yui3-menu .yui3-menu-children,
.sm-page-widget-nav .sm-page-widget-nav-popover.sm-page-widget-nav-sublinks-separator .yui3-menu .yui3-menu-label {
padding: 7px 7px 7px 7px;
}
/* Set the navbar submenu hover background color */
.yui3-menu .yui3-menu-children .yui3-menu-item .yui3-menu-label:hover {
background: #888eb2;
opacity: .75;
}
Thanks.
SmugMug Hero & CSS Monkey
https://help.smugmug.com/get-started-with-customization-SkgwJ4rM
Hmmm... how close could I get to what I want by continuing down the current path?
I can imagine that starting a new one from scratch would be better for someone who knows what they're doing, but I don't. Unless there's some kind of template that's pretty close to what I'm looking for that I could work from. If so, could you tell me where to find it? I just now did a search but couldn't come up with anything.
http://css3menu.com/
But there are tons of others.
SmugMug Hero & CSS Monkey
https://help.smugmug.com/get-started-with-customization-SkgwJ4rM
In the meantime, if possible could get your help to create a temporary fix just for the following?
1) Changing the button background color opacity while keeping text opaque (desktop)
2) Rounding the corners of the mobile "MENU" button background, changing the color, and changing the width (mobile)
If so it would be fantastic) Thanks!
SmugMug Hero & CSS Monkey
https://help.smugmug.com/get-started-with-customization-SkgwJ4rM
Thanks for the code, but actually what I was asking in the last post was to be able to adjust the transparency of the rounded buttons (the ones that are now blue/purple) so that they can fade a bit, but so the text stays at 100% opacity. When I tried lowering the opacity of the buttons before, it also lowered the opacity of the text.
In my previous post I also asked about changing the mobile "MENU" button background (color, rounded corners, width). Is this doable?
Thanks!
Was like this
background: none repeat scroll 0% 0% #888EB2;
opacity: 1;
My Website index | My Blog
Now, sorry to be a pest, but how about the mobile menu button?
Thanks!
My Website index | My Blog
opacity: 1;
from each of the two rules in above post #10. It will effect the whole block including the text.
My Website index | My Blog
I know bobbyhero recommended creating a new navbar from scratch, and I fully plan to do that at some point, because I'm interested in learning more, but I'm so close to being satisfied with what I've got now (for the time being, anyway), I thought I'd ask and see if the following can be done by adjusting the code I've already got:
1) Make the navbar topmenu items clickable on the whole area of each individual background (the light blue-grey area with the rounded corners), not just the text. Basically I want the topmenu buttons to act the way the sub-menu buttons do, where you can click/hover anywhere within the button area and the button is selectable and the background color change when hovering covers the whole button, and not just where the text is.
2) When hovering over the sub-menu items, there is a light grey rectangular box that shows up just outside the right and left edges of the button that the cursor is over. I'd love to be able to just make that transparent. Just to be clear, I'm not talking about the big boxes that encompass the entire submenus: I'm ok with those big boxes being opaque (or maybe translucent). I'm talking about the ones that show up just when hovering on one individual sub-menu button. I know I could sort of fix this by changing the big box color to match those little boxes, but I'd prefer to just get rid of the little boxes altogether.
If I could get these two issues fixed I'd be really psyched. Thanks so much!
-Rob
/* Change the navbar fonts */
.sm-page-widget-nav-toplink, .yui3-menu-item .yui3-menu-label,
.sm-page-widget-nav-toplink > a {
color: #201864 !important;
}
/* Turn the navbar text a different color when the mouse hovers over it */
.sm-user-ui .sm-page-widget-nav-toplink a:hover {
color: #e3af01!important;
}
/*Adds Hover Transition Effect to Nav Bar*/
a {
-webkit-transition:color 0.1s ease-in;
-moz-transition:color 0.1s ease-in;
transition:color 0.1s ease-in;
}
.yui3-menu-children {
opacity: 0;
transition: opacity 0.15s ease-out;
}
.yui3-menu-open > .yui3-menu-children {
opacity: 1;
}
/* Nav bar borders */
/* Add a curved background to each link in the menu (nav) bar */
.sm-page-widget-nav-toplink, .sm-page-widget-nav-toplink:last-child {
background: rgba(136,142,178, 0.15);
opacity: 1;
border-radius: 100px;
padding: 7.5px 7.5px 7.5px 14px !important;
margin-bottom: 15px !important;
}
/* Turn the navbar background a different color when the mouse hovers over it */
.sm-user-ui .sm-page-widget-nav-toplink a:hover {
background: rgba(136,142,178, 1); !important;
opacity: 1;
border-radius: 100px;
padding: 7.5px 15px 7.5px 15px !important;
margin-bottom: 15px !important;
margin-left: -14px !important;
}
/* Set the default navbar submenu background color */
.yui3-menu .yui3-menu-children .yui3-menu-item .yui3-menu-label {
background: rgba(136,142,178, 0.15);
border-radius: 100px;
margin-top: 10px !important;
margin-bottom: 10px !important;
margin-left: 20px !important;
margin-right: 20px !important;
padding: 6px 15px 6px 15px !important;
}
/* Change the border color */
.yui3-menu .yui3-menu-children,
.sm-page-widget-nav .sm-page-widget-nav-popover.sm-page-widget-nav-sublinks-separator .yui3-menu .yui3-menu-label {
padding: 7px 7px 7px 7px;
color: #bdbdbd;
}
/* Set the navbar submenu hover background color */
.yui3-menu .yui3-menu-children .yui3-menu-item .yui3-menu-label:hover {
background: #888eb2;
opacity: 1;
}
BTW, where do you have all this menu CSS? In "entire site" CSS?
My Website index | My Blog
My Website index | My Blog
My Website index | My Blog
.yui3-menu .yui3-menu-children .yui3-menu-item .yui3-menu-label:hover
is second.
My Website index | My Blog
My Website index | My Blog
Try this below http://www.dgrin.com/showpost.php?p=1966751&postcount=27
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
...I guess it isn't exactly 100% correct.
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
And add this:
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
Hikin' Mike, I tried putting in the code you suggested, but I think I must have done it wrong. Maybe I misunderstood. First I replaced the old code with the new code from your last post, than I tried also adding the code from your previous post, but I still got the same result. The full button is clickable now, and the hover color covers it, which is great, but there's a second button/shaded area outside the original one (I attached a screenshot) in the nav topmenu now, and the alignment of everything has shifted also. What did I do wrong? Thanks)
Looks like you removed the code I gave you. Can't trouble shoot something if I/we can't see it.
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk