Note that there are some explanatory texts on larger screens.

plurals
  1. PODisplay menu horizontal with vertical drop down?
    primarykey
    data
    text
    <p>I am trying to build a drop down menu, So far i found a really nice menu but it lists its items horizontal and displays its sub items horizontally as well.</p> <p>I would like my items to be next to each other and then if it has a sub menu those items drop down.</p> <p>Here is my Menu:</p> <pre><code>&lt;link rel="stylesheet" type="text/css" href="../../Content/Menu.css" /&gt; &lt;div class="float-right"&gt; &lt;nav&gt; &lt;ul class="menu" style="float: left;"&gt; &lt;li class="item1"&gt;&lt;a href="#" class=""&gt;Home&lt;/a&gt; &lt;ul style="display: block; "&gt; &lt;li class="subitem1" &gt;@Html.ActionLink("Home", "Index", "Home", new { @class = "active" })&lt;/li&gt; &lt;li class="subitem2"&gt;@Html.ActionLink("Contact", "Contact", "Home")&lt;/li&gt; &lt;li class="subitem3"&gt;@Html.ActionLink("About", "About", "Home")&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li class="item2"&gt;@Html.ActionLink("Login", "Login", "Home")&lt;/li&gt; &lt;/ul&gt; &lt;/nav&gt; &lt;/div&gt; </code></pre> <hr> <p>Style Sheet</p> <pre><code>body { font-size: 100%; background:#32373d; } a { text-decoration: none; } ul, ul ul { margin: 0; padding: 0; list-style: none; } #wrapper { width: 220px; margin: 100px auto; font-size: 0.8125em; } .menu { width: 225px; height: auto; -webkit-box-shadow: 0px 1px 3px 0px rgba(0,0,0,.73), 0px 0px 18px 0px rgba(0,0,0,.13); -moz-box-shadow: 0px 1px 3px 0px rgba(0,0,0,.73), 0px 0px 18px 0px rgba(0,0,0,.13); box-shadow: 0px 1px 3px 0px rgba(0,0,0,.73), 0px 0px 18px 0px rgba(0,0,0,.13); } .menu &gt; li &gt; a { background-color: #616975; background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(114, 122, 134)),to(rgb(80, 88, 100))); background-image: -webkit-linear-gradient(top, rgb(114, 122, 134), rgb(80, 88, 100)); background-image: -moz-linear-gradient(top, rgb(114, 122, 134), rgb(80, 88, 100)); background-image: -o-linear-gradient(top, rgb(114, 122, 134), rgb(80, 88, 100)); background-image: -ms-linear-gradient(top, rgb(114, 122, 134), rgb(80, 88, 100)); background-image: linear-gradient(top, rgb(114, 122, 134), rgb(80, 88, 100)); filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr='#727a86', EndColorStr='#505864'); border-bottom: 1px solid #33373d; -webkit-box-shadow: inset 0px 1px 0px 0px #878e98; -moz-box-shadow: inset 0px 1px 0px 0px #878e98; box-shadow: inset 0px 1px 0px 0px #878e98; width: 100%; height: 2.75em; line-height: 2.75em; text-indent: 2.75em; display: block; position: relative; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-weight: 600; color: #fff; text-shadow: 0px 1px 0px rgba(0,0,0,.5); } .menu ul li a { background: #fff; border-bottom: 1px solid #efeff0; width: 100%; height: 2.75em; line-height: 2.75em; text-indent: 2.75em; display: block; position: relative; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 0.923em; font-weight: 400; color: #878d95; } .menu ul li:last-child a { border-bottom: 1px solid #33373d; } .menu &gt; li &gt; a:hover, .menu &gt; li &gt; a.active { background-color: #35afe3; background-image: -webkit-gradient(linear, left top, left bottom, from(rgb(69, 199, 235)),to(rgb(38, 152, 219))); background-image: -webkit-linear-gradient(top, rgb(69, 199, 235), rgb(38, 152, 219)); background-image: -moz-linear-gradient(top, rgb(69, 199, 235), rgb(38, 152, 219)); background-image: -o-linear-gradient(top, rgb(69, 199, 235), rgb(38, 152, 219)); background-image: -ms-linear-gradient(top, rgb(69, 199, 235), rgb(38, 152, 219)); background-image: linear-gradient(top, rgb(69, 199, 235), rgb(38, 152, 219)); filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,StartColorStr='#45c7eb', EndColorStr='#2698db'); border-bottom: 1px solid #103c56; -webkit-box-shadow: inset 0px 1px 0px 0px #6ad2ef; -moz-box-shadow: inset 0px 1px 0px 0px #6ad2ef; box-shadow: inset 0px 1px 0px 0px #6ad2ef; } .menu &gt; li &gt; a.active { border-bottom: 1px solid #1a638f; } .menu &gt; li &gt; a:before { content: ''; background-image: url(../images/sprite.png); background-repeat: no-repeat; font-size: 36px; height: 1em; width: 1em; position: absolute; left: 0; top: 50%; margin: -.5em 0 0 0; } .item1 &gt; a:before { background-position: 0 0; } .item2 &gt; a:before { background-position: -38px 0; } .item3 &gt; a:before { background-position: 0 -38px; } .item4 &gt; a:before { background-position: -38px -38px; } .item5 &gt; a:before { background-position: -76px 0; } .menu &gt; li &gt; a span { font-size: 0.857em; display: inline-block; position: absolute; right: 1em; top: 50%; background: #48515c; line-height: 1em; height: 1em; padding: .4em .6em; margin: -.8em 0 0 0; color: #fff; text-indent: 0; text-align: center; -webkit-border-radius: .769em; -moz-border-radius: .769em; border-radius: .769em; -webkit-box-shadow: inset 0px 1px 3px 0px rgba(0, 0, 0, .26), 0px 1px 0px 0px rgba(255, 255, 255, .15); -moz-box-shadow: inset 0px 1px 3px 0px rgba(0, 0, 0, .26), 0px 1px 0px 0px rgba(255, 255, 255, .15); box-shadow: inset 0px 1px 3px 0px rgba(0, 0, 0, .26), 0px 1px 0px 0px rgba(255, 255, 255, .15); text-shadow: 0px 1px 0px rgba(0,0,0,.5); font-weight: 500; } .menu &gt; li &gt; a:hover span, .menu &gt; li a.active span { background: #2173a1; } .menu &gt; li &gt; ul li a:before{ content: '▶'; font-size: 8px; color: #bcbcbf; position: absolute; width: 1em; height: 1em; top: 0; left: -2.7em; } .menu &gt; li &gt; ul li:hover a, .menu &gt; li &gt; ul li:hover a span, .menu &gt; li &gt; ul li:hover a:before { color: #32373D; } .menu ul &gt; li &gt; a span { font-size: 0.857em; display: inline-block; position: absolute; right: 1em; top: 50%; / background: #fff; border: 1px solid #d0d0d3; line-height: 1em; height: 1em; padding: .4em .7em; margin: -.9em 0 0 0; color: #878d95; text-indent: 0; text-align: center; -webkit-border-radius: .769em; -moz-border-radius: 769em; border-radius: 769em; text-shadow: 0px 0px 0px rgba(255,255,255,.01)); } </code></pre> <p>What property in my style sheet is causing my Menu to list like this?</p> <p>Is there a way to override what every is causing the menu you to do this?</p> <hr> <p>Edit</p> <p>Html list:</p> <pre><code>&lt;div class="float-right"&gt; &lt;nav&gt; &lt;ul class="menu" style="float: left;"&gt; &lt;li class="item1"&gt;&lt;a href="#" class=""&gt;Home&lt;/a&gt; &lt;ul style="display: block; "&gt; &lt;li class="subitem1" &gt;&lt;a class="active" href="/?Length=4"&gt;Home&lt;/a&gt;&lt;/li&gt; &lt;li class="subitem2"&gt;&lt;a href="/Home/Contact"&gt;Contact&lt;/a&gt;&lt;/li&gt; &lt;li class="subitem3"&gt;&lt;a href="/Home/About"&gt;About&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li class="item2"&gt;&lt;a href="/Home/Login"&gt;Login&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/nav&gt; &lt;/div&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload