html - Left align drop down menu under parent -
html - Left align drop down menu under parent -
i've spent days trying left-align drop downwards menus under parents. css & html know i've learned through process in past few days, treat me kid in responses, lol. you'll see i've survived far making notes on means...
here's blog can see it's doing crittndesign.blogspot.com started out "featured products" tab & drop downwards when created menu. in order align drop downwards under parent, set actual value on how far left wanted (68px seemed work). did wanted time being, decided add together "inspiration for..." tab , see need prepare problem , have proper coding menus left align under own parent tabs.
my code mess since i've tried many different things now, need tell me alter create right! read lot needing position either "relative" or "inline-block" apparently don't know stick because breaks drop downwards remove fixed position (left: 68px). allow me know if need other info in order help me figure out!
thanks in advance!!
css
.navigation ul ul { display: none; } .navigation ul li:hover > ul { display: block; } .navigation li ul { position: absolute; /*makes list drop down*/ z-index:100; /*makes remain visible when moving mouse downwards it*/ left: -999em; /*em=scaleable*/ width: 165px; /*width of drop downwards box*/ margin: 19px 0 0 0; padding: 0; } .navigation li:hover ul { left: 68px; /* position of drop downwards menu aligned under parent */ } .navigation li li { /*how drop downwards menu looks*/ display: block; background: #663300; width: 140px; /*width of background color on drop down*/ color: #ff9900; font:normal 12px helvetica, sans-serif; padding: 9px 13px 12px 12px; text-decoration: none; text-align:center; border-bottom: 2px dotted #060505; /*dotted line under each menu item in drop down*/ } .navigation li li a:hover { /*how drop downwards menu looks when hovered over*/ background: #060505; color: #ffffff; margin: 0; padding: 9px 13px 12px 12px; /*for list names when hovered on them*/ text-decoration: bold; border-bottom: 1px #060505; text-align:center; box-shadow: inset 0 0 10px #222222, inset 0 10px 10px #222222; } li:hover > { /*color hovered links, , maintain menu item colored when hovering sub-menu*/ background-color: #663300; } .navigation li ul ul { /*margin: -35px 0 0 145px;*/ } .navigation li:hover ul ul { left: -9999em; } .navigation li ul li:hover ul { left: auto; }
i don't know markup, seek this...
.navigation ul{ padding:0; }
all ul's have default padding , margin, dropped ul's in parent ul, should have 0 padding align left.
html css drop-down-menu parent-child
Comments
Post a Comment