html
1<ul class="nav"> 2 <li><a href="#" class="nav-item">あ</a></li> 3 <li><a href="#" class="nav-item">い</a></li> 4 <li><a href="#" class="nav-item">う</a></li> 5 <li><a href="#" class="nav-item">え</a></li> 6 <li><a href="#" class="nav-item hover-item">お</a> 7 <ul> 8 <li><a href="#" class="nav-item">か</a></li> 9 <li><a href="#" class="nav-item">き</a></li> 10 <li><a href="#" class="nav-item">く</a></li> 11 </ul> 12 </li> 13</ul>
sass
1.nav { 2 max-width: 900px; 3 height: 42px; 4 box-sizing: border-box; 5 padding: 0; 6 position: absolute; 7 right: 0; 8 top:23px; 9 @extend %u-clear; 10 >li { 11 width: 100px; 12 height: 42px; 13 text-align: center; 14 float: left; 15 border-right: 2px dotted #e4e3e3; 16 font-size: 12px; 17 font-weight:bold; 18 line-height: 42px; 19 &.last-item { 20 border-right: none; 21 } 22 } 23} 24.nav-item { 25 width: 100%; 26 height: 100%; 27 position: relative; 28 display: inline-block; 29 text-decoration: none; 30} 31.hover-item ul{ 32 overflow: hidden; 33 width: 100px; 34 height: 42px; 35 -moz-transition: .2s; 36 -webkit-transition: .2s; 37 -o-transition: .2s; 38 -ms-transition: .2s; 39 transition: .2s; 40 &:hover { 41 height: 168px; 42 43 } 44}
sass
1%u-clear { 2 zoom: 1; 3 4 &:before, 5 &:after { 6 content: ""; 7 display: block; 8 } 9 10 &:after { 11 clear: both; 12 } 13}
reset
1/* http://meyerweb.com/eric/tools/css/reset/ 2 v2.0 | 20110126 3 License: none (public domain) 4*/ 5 6html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { 7 margin: 0; 8 padding: 0; 9 border: 0; 10 font-family: $font-jp; 11 font-size: 100%; 12 font: inherit; 13 vertical-align: baseline; } 14 15/* HTML5 display-role reset for older browsers */ 16 17article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { 18 display: block; } 19 20body { 21 position: relative; 22 line-height: 1; } 23 24ol, ul { 25 list-style: none; } 26 27blockquote, q { 28 quotes: none; } 29 30blockquote { 31 &:before, &:after { 32 content: ''; 33 content: none; } } 34 35q { 36 &:before, &:after { 37 content: ''; 38 content: none; } } 39 40table { 41 border-collapse: collapse; 42 border-spacing: 0; }
メニューリストがある中で一箇所だけプルダウンにしたいと思っております。
現在、『お』の<a>
タグの要素が伸びてしまったり『お』の下に『か』が出ていて『か』をホバーすると
その下の要素が出てくるというあと一歩のところで悩んでおります。
回答2件
あなたの回答
tips
プレビュー