Note that there are some explanatory texts on larger screens.

plurals
  1. POStyling the Thesis dropdown menu with CSS
    primarykey
    data
    text
    <p>I'm using the Wordpress Thesis theme which comes with a standard dropdown menu which I want to turn into a two-tier horizontal menu. What I'd like to have is that when you click on a parent item, the children of that parent (but no other children) are visisble.</p> <p>The structure is like this:</p> <pre><code>&lt;ul class="menu"&gt; &lt;li class="tab tab-home"&gt;&lt;a href="http://dirtydeals.org.uk"&gt;Home&lt;/a&gt;&lt;/li&gt; &lt;li class="tab tab-1 current-parent"&gt;&lt;a href="http://dirtydeals.org.uk/about/" title="About"&gt;About&lt;!--[if gte IE 7]&gt;&lt;!--&gt;&lt;/a&gt;&lt;!--&lt;![endif]--&gt; &lt;!--[if lte IE 6]&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;![endif]--&gt; &lt;ul class="submenu submenu-1"&gt; &lt;li class="item item-1 current"&gt;&lt;a href="http://dirtydeals.org.uk/about/subnavigation- page/" title="Subnavigation page"&gt;Subnavigation page&lt;/a&gt;&lt;/li&gt; &lt;li class="item item-2"&gt;&lt;a href="http://dirtydeals.org.uk/about/sub-page/" title="Sub- page"&gt;Sub-page&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;!--[if lte IE 6]&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/a&gt;&lt;![endif]--&gt; &lt;/li&gt; &lt;li class="tab tab-2"&gt;&lt;a href="http://dirtydeals.org.uk/action/" title="action"&gt;action&lt;/a&gt;&lt;/li&gt; &lt;li class="tab tab-3"&gt;&lt;a href="http://dirtydeals.org.uk/media/" title="Media"&gt;Media&lt;!--[if gte IE 7]&gt;&lt;!--&gt;&lt;/a&gt;&lt;!--&lt;![endif]--&gt; &lt;!--[if lte IE 6]&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;![endif]--&gt; &lt;ul class="submenu submenu-1"&gt; &lt;li class="item item-3"&gt;&lt;a href="http://dirtydeals.org.uk/media/sample-page-2/" title="Sample Page"&gt;Blog&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;!--[if lte IE 6]&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/a&gt;&lt;![endif]--&gt; &lt;/li&gt; &lt;/ul&gt; </code></pre> <p>I've got it working reasonably well, however, the problem is that I can't find a way to specifically target the child items specifically. If I hide 'Blog' when 'About' is viewed, then it also hides the child items of 'About' or hides the whole submenu when one of the children of 'About' is viewed. </p> <p>Here's my CSS:</p> <pre><code>/*Remove the hover drop-down effect*/ .custom .menu ul { position: absolute; visibility: visible; list-style: none; z- index: 110; } /*No clears on this so we can make the submenu horizontal*/ .custom .menu ul li { clear: none; } /*Styling the submenu*/ .custom ul.submenu { margin: 0px 0 0 0; } .custom ul.submenu a { font-size: 1.3em; text-transform: uppercase; padding-right: 10px; } .custom ul.menu li ul.submenu li.item { display: inline; } .custom ul.menu li.current ul.submenu li.item { display: inline; } .custom ul.menu li { border: 1px solid red; } .custom ul.menu li ul.submenu li.item a { } /*Hacking the submenu to make children work when a subpage is viewed*/ .custom ul.menu li ul.submenu li.item a { display: inline; } .custom ul.menu li ul.submenu li.item a { border: 1px solid yellow; } .custom ul.menu li.current-parent ul.submenu { border: 1px solid blue;} .custom ul.menu li.current-parent ul.submenu li.item a { border: 1px solid white; } .custom ul.menu li.current ul.submenu { background-color: #444444; padding: 10px; width: 500px; } .custom ul.menu li.current ul.submenu li.item { display: inline; white-space: nowrap; } .custom ul.menu li.current ul.submenu li.item a { background-color: transparent; display: inline; } .menu ul, .menu ul li { width: 18em; } .custom ul.menu li.current ul.submenu li.item:after { content: "/"; font-size: 14px; } .custom ul.menu li.current ul.submenu li:last-child:after { content: ""; } /*Annoyingly each individual submenu has to be positioned separately*/ .custom ul.menu li.current ul.submenu-1 { position: absolute; left: -110px; } </code></pre> <p>Could someone with a more logical brain and better eye than me have a look please? Thanks!</p> <p>The page is here: <a href="http://dirtydeals.org.uk/about/subnavigation-page/" rel="nofollow">http://dirtydeals.org.uk/about/subnavigation-page/</a></p>
    singulars
    1. This table or related slice is empty.
    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.
    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