html - How to slide-out a submenu from under the navigation bar using CSS transition? -


i've been trying create transition effect where, on hover, sub menu slides out underneath main navigation bar. far, i've got elements in place , wasted hours playing around different methods various posts, no avail.

here jsfiddle.

i'm guessing i'm gonna have rid of display: none -> display: block way of hiding submenu no transitions various other methods such transitioning max-height, opacity, pulling down massive top value etc have failed. inflated top value method, submenu slides on rather under , changing z-index values somehow pushes behind while turning background transparent. weird behaviour.

i appreciate if explain me how go creating smooth slide-out transition sub-menu.

thank you

transforming scale or transitioning max-height: 0 better option navigational elements.

jsfiddle

if initial state of element "display: none" passed on in dom hide element (as children) assistive technology.

also, can use sibling sectors select .dropdown, instead of overly nesting elements

adjacent sibling: .dropbtn:hover + .dropdown_content


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

Cross-Compiling Linux Kernel for Raspberry Pi - ${CCPREFIX}gcc -v does not work -

java.lang.NoClassDefFoundError When Creating New Android Project -