Border radius on last-child menu Item Hover
Etienne
Registered Users Posts: 70 Big grins
Hi,
I have a submenu where I apply a border-radius:0 0 8px 8px ;
And I want to apply the border-radius:0 0 8px 8px on the last-child ITEM on hover, not others, but it does not work.
My submenu use transparency.
Heres is my code ( border radius at the end) and a capture showing the border radius on others items than last-child (on hover).
What's wrong in the code ?
.yui3-menu {
background: rgba(224,138,21,0);
}
.yui3-menu-children {
margin-top: 0px !important;
background: rgba(224,138,21,0.3) !important;
}
.yui3-menu-item .yui3-menu-label {
background: rgba(224,138,21,0);
opacity: 1;
-webkit-transition:all 0.4s ease-in;
-moz-transition:all 0.4s ease-in;
transition:all 0.4s ease-in;
}
.yui3-menu .yui3-menu-children .yui3-menu-item .yui3-menu-label:hover {
background: rgba(224,138,21,0.7);
}
/* Code for border radius */
.yui3-menu-children { /* Works */
border-radius:0 0 8px 8px !important ;
}
.yui3-menu .yui3-menu-children .yui3-menu-item .yui3-menu-label:last-child:hover {
border-radius:0 0 8px 8px ; /* don't work : all the item not only last */
}
I have a submenu where I apply a border-radius:0 0 8px 8px ;
And I want to apply the border-radius:0 0 8px 8px on the last-child ITEM on hover, not others, but it does not work.
My submenu use transparency.
Heres is my code ( border radius at the end) and a capture showing the border radius on others items than last-child (on hover).
What's wrong in the code ?
.yui3-menu {
background: rgba(224,138,21,0);
}
.yui3-menu-children {
margin-top: 0px !important;
background: rgba(224,138,21,0.3) !important;
}
.yui3-menu-item .yui3-menu-label {
background: rgba(224,138,21,0);
opacity: 1;
-webkit-transition:all 0.4s ease-in;
-moz-transition:all 0.4s ease-in;
transition:all 0.4s ease-in;
}
.yui3-menu .yui3-menu-children .yui3-menu-item .yui3-menu-label:hover {
background: rgba(224,138,21,0.7);
}
/* Code for border radius */
.yui3-menu-children { /* Works */
border-radius:0 0 8px 8px !important ;
}
.yui3-menu .yui3-menu-children .yui3-menu-item .yui3-menu-label:last-child:hover {
border-radius:0 0 8px 8px ; /* don't work : all the item not only last */
}
0
Comments
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 fixed the problem on one site changing this code (for information) :
.horizontal ul li li > a:last-child:hover {
border-radius:0 0 8px 8px ;
}
And it works now for the last-child border radius.
But the exactly same code do not fix the problem on my other site (other post) : I 'm trying to understand the reason .....
border-radius:0 0 8px 8px !important;
My Website index | My Blog
Because the two sites you sent me (via PM) do NOT have the same code.
Site #1 Site #2
When I copy #2 code into #1 site, it works fine.
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 copied (not on production) only the code with the radius border and the submenu, it's why you do not see the same code on production.
I copy the whole code to try, and it's good now, thanks.
Just for info, where do you see all the CSS code ?
when I use this transition : Menu Transition 1 ------------------------------->
.sm-page-content .yui3-menu-children {
position: absolute;
top: 2em; left: 0;
max-height:0em;
margin: 0; padding: 0;
overflow: hidden;
transition: 1s max-height 0.1s;
border-radius: 0 0 8px 8px;
}
.sm-page-content .horizontal > .sm-page-widget-nav-toplink:hover .yui3-menu-children {
max-height:15em;
}
<-------------------------------
the border radius for the last-child works
(.horizontal ul ul li > a:last-child:hover {
border-radius:0 0 8px 8px ;
})
BUT when I use an other kind of transition : Menu Transition 2 ------------------------------->
.yui3-menu-children {
opacity: 0;
transition: opacity 0.40s ease-out;
border-radius: 0 0 8px 8px;
}
.yui3-menu-open > .yui3-menu-children {
opacity: 1;
}
<-------------------------------
the border radius for the last-child do not work
.horizontal ul ul li > a:last-child:hover {
border-radius:0 0 8px 8px ;
}
Stange. So if I want to use Transition 2, it does not work,
and it's work for Transition 1 for the same whole code.
I don't see the connection.
I've a question on Menu Transition 1, perhaps an other trhead :
The submenu scroll down with animation , but instead of scroll up with animation (like on website where I see the same code), the submenu disapear.
Do you know why ?
The original code is :
#menu ul { position: absolute; top: 2em; left: 0; max-height:0em; margin: 0; padding: 0; background-color: #ddd; background-image: linear-gradient(#fff,#ddd); overflow: hidden; transition: 1s max-height 0.3s; border-radius: 0 0 8px 8px; } /* ici on change la valeur de max-height au :hover */ #menu > li:hover ul { /* à adapter, le minimum est le meilleur mais voyez large */ max-height: 13em; }
Thanks
Either looking at the Source Code or using Firebug.
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
Images in the Backcountry
My SmugMug Customizations | Adding CSS to Your Site | SEO for the Photographer | Locate Your Page/Widget Number | SmugMug Help Desk
.sm-user-ui .yui3-menu-children,
.sm-user-ui .yui3-menu-children .yui3-menu-item:last-child:hover {
border-radius: 0 0 8px 8px;
}
it do not work with the Menu Transition 2
>
.yui3-menu-children {
opacity: 0;
transition: opacity 0.40s ease-out;
border-radius: 0 0 8px 8px;
}
.yui3-menu-open > .yui3-menu-children {
opacity: 1;
}
Perhaps it's because I use transparency for all the menu .....
very strange.