<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

	<title>Comments on: CSS Help!</title>
	<link>http://ask.metafilter.com/44387/CSS-Help/</link>
	<description>Comments on Ask MetaFilter post CSS Help!</description>
	<pubDate>Mon, 14 Aug 2006 12:30:37 -0800</pubDate>
	<lastBuildDate>Mon, 14 Aug 2006 12:30:37 -0800</lastBuildDate>
	<language>en-us</language>
	<docs>http://blogs.law.harvard.edu/tech/rss</docs>
	<ttl>60</ttl>

	<item>
		<title>Question: CSS Help!</title>
		<link>http://ask.metafilter.com/44387/CSS-Help</link>	
		<description>CSS Help! I have a menu which uses links ( &lt;a&gt; tags ) and I want to make it so when I hover over an item in the menu, it makes a list visible!&lt;/a&gt; &lt;br /&gt;&lt;br /&gt; Here is the thing, I have a menu like this:&lt;br&gt;
&lt;br&gt;
a.nav1 {background-position:0 150px;}&lt;br&gt;
a.nav1 .button {background:azure; color:#000; cursor:pointer; display:block; width:128px; height:25px; cursor:hand;}&lt;br&gt;
&lt;br&gt;
a.nav1:hover {background-position:0 0;}&lt;br&gt;
a.nav1:hover .button {background:#f80; color:#fff; cursor:pointer; display:block; width:128px; height:25px; cursor:hand;}&lt;br&gt;
&lt;br&gt;
And I have a sub-menu using a list, like this:&lt;br&gt;
/* remove the bullets, padding and margins from the lists */&lt;br&gt;
ul.menu {&lt;br&gt;
	background:azure;&lt;br&gt;
	list-style-type:none;&lt;br&gt;
	padding:0;&lt;br&gt;
	margin:0;&lt;br&gt;
	visibility:hidden;&lt;br&gt;
	position:absolute;&lt;br&gt;
	width:128px;&lt;br&gt;
	height:280px;&lt;br&gt;
	top:152px;&lt;br&gt;
}&lt;br&gt;
&lt;br&gt;
I want to make it so that when I hover over a1.nav, it makes the ul.menu visible. However this doesnt seem to work if I simply add the line:&lt;br&gt;
&lt;br&gt;
a1.nav:hover ul.menu {visibility:visible}&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Please help me make it so that when I hover over a1.nav that I can make ul.menu visible!</description>
		<guid isPermaLink="false">post:ask.metafilter.com,2006:site.44387</guid>
		<pubDate>Mon, 14 Aug 2006 12:30:07 -0800</pubDate>
		<dc:creator>LoopyG</dc:creator>
		
			<category>CSS</category>
		
	</item> <item>
		<title>By: LoopyG</title>
		<link>http://ask.metafilter.com/44387/CSS-Help#680510</link>	
		<description>by the way, that was meant to be &apos;&lt; &apos;a&apos;&gt;&apos; tags, without the apostraphes&lt;/&gt;</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.44387-680510</guid>
		<pubDate>Mon, 14 Aug 2006 12:30:37 -0800</pubDate>
		<dc:creator>LoopyG</dc:creator>
	</item><item>
		<title>By: staggernation</title>
		<link>http://ask.metafilter.com/44387/CSS-Help#680529</link>	
		<description>&lt;i&gt;a1.nav:hover ul.menu {visibility:visible}&lt;/i&gt;&lt;br&gt;
&lt;br&gt;
Shouldn&apos;t that be &lt;code&gt;a.nav1&lt;/code&gt; instead of &lt;code&gt;a1.nav&lt;/code&gt;?</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.44387-680529</guid>
		<pubDate>Mon, 14 Aug 2006 12:46:52 -0800</pubDate>
		<dc:creator>staggernation</dc:creator>
	</item><item>
		<title>By: LoopyG</title>
		<link>http://ask.metafilter.com/44387/CSS-Help#680542</link>	
		<description>My mistake, I should have copied and pasted, it does indeed say&lt;br&gt;
&lt;br&gt;
a.nav1:hover ul.menu {visibility:hidden;}&lt;br&gt;
&lt;br&gt;
And does not work even when typed correctly   =)</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.44387-680542</guid>
		<pubDate>Mon, 14 Aug 2006 12:56:59 -0800</pubDate>
		<dc:creator>LoopyG</dc:creator>
	</item><item>
		<title>By: juiceCake</title>
		<link>http://ask.metafilter.com/44387/CSS-Help#680546</link>	
		<description>I don&apos;t have the answer as I haven&apos;t had time to play with this sort of thing yet. However, you may find the answer here:&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://www.cssplay.co.uk/index.html&quot;&gt;CSS Play&lt;/a&gt;.&lt;br&gt;
&lt;br&gt;
More particularly in the &lt;a href=&quot;http://www.cssplay.co.uk/menus/index.html&quot;&gt;Menu&lt;/a&gt; section.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.44387-680546</guid>
		<pubDate>Mon, 14 Aug 2006 13:00:27 -0800</pubDate>
		<dc:creator>juiceCake</dc:creator>
	</item><item>
		<title>By: staggernation</title>
		<link>http://ask.metafilter.com/44387/CSS-Help#680557</link>	
		<description>Well, that rule will only work if &lt;code&gt;ul.menu&lt;/code&gt; is contained within &lt;code&gt;a.nav1&lt;/code&gt;, which seems sort of weird (having an entire menu inside a link). Is that actually what you&apos;re trying to do?</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.44387-680557</guid>
		<pubDate>Mon, 14 Aug 2006 13:04:24 -0800</pubDate>
		<dc:creator>staggernation</dc:creator>
	</item><item>
		<title>By: malevolent</title>
		<link>http://ask.metafilter.com/44387/CSS-Help#680568</link>	
		<description>You&apos;re putting a list inside a link? Ugh, might be a good idea to rethink the markup and consult the various dropdown articles at &lt;a href=&quot;http://www.alistapart.com/&quot;&gt;A List Apart&lt;/a&gt;.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.44387-680568</guid>
		<pubDate>Mon, 14 Aug 2006 13:10:02 -0800</pubDate>
		<dc:creator>malevolent</dc:creator>
	</item><item>
		<title>By: LoopyG</title>
		<link>http://ask.metafilter.com/44387/CSS-Help#680572</link>	
		<description>I do not have the list inside the link, and did not realize that I would have to do so. I am a C++ programmer, new to CSS/HTML. Was hoping to be able to have something akin to a &quot;Friend&quot; class, where the link could affect the lists properties. If needbe, I can redo this whole thing by making my menu a list as well, and then having a sub-list within the main list. Is this a better solution?</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.44387-680572</guid>
		<pubDate>Mon, 14 Aug 2006 13:12:06 -0800</pubDate>
		<dc:creator>LoopyG</dc:creator>
	</item><item>
		<title>By: malevolent</title>
		<link>http://ask.metafilter.com/44387/CSS-Help#680588</link>	
		<description>Ah right, if you read a few CSS dropdown articles it should make things clearer (basically, with care you can do it with pure CSS in Firefox etc. using &lt;a href=&quot;http://meyerweb.com/eric/articles/webrev/200007a.html&quot;&gt;adjacent-sibling selectors&lt;/a&gt;, but have to resort to a bit of JavaScript to cater for IE).</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.44387-680588</guid>
		<pubDate>Mon, 14 Aug 2006 13:17:25 -0800</pubDate>
		<dc:creator>malevolent</dc:creator>
	</item><item>
		<title>By: juiceCake</title>
		<link>http://ask.metafilter.com/44387/CSS-Help#680593</link>	
		<description>&quot;but have to resort to a bit of JavaScript to cater for IE).&quot;&lt;br&gt;
&lt;br&gt;
If you visit &lt;a href=&quot;http://www.cssplay.co.uk/index.html&quot;&gt;CSS Play&lt;/a&gt;, you&apos;ll find solutions where you don&apos;t have to resort to JavaScript, and furthermore, solutions that validate, despite the IE hacks.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.44387-680593</guid>
		<pubDate>Mon, 14 Aug 2006 13:20:11 -0800</pubDate>
		<dc:creator>juiceCake</dc:creator>
	</item><item>
		<title>By: Pigpen</title>
		<link>http://ask.metafilter.com/44387/CSS-Help#680629</link>	
		<description>Put your menu links in a list, then nest the list of tags inside those LIs (but not inside the A tag.)</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.44387-680629</guid>
		<pubDate>Mon, 14 Aug 2006 13:34:06 -0800</pubDate>
		<dc:creator>Pigpen</dc:creator>
	</item><item>
		<title>By: AmbroseChapel</title>
		<link>http://ask.metafilter.com/44387/CSS-Help#680638</link>	
		<description>Short answer, especially if you&apos;re not a fulltime CSS/JS coder: use &lt;a href=&quot;http://www.htmldog.com/articles/suckerfish/dropdowns/&quot;&gt;SuckerFish&lt;/a&gt;,  which is generally acknowledged to be the most solid and the most valid CSS-drop-menu system. &lt;br&gt;
&lt;br&gt;
Even if you get yours working, you&apos;ll then find you need ten little wrinkles for ten different browsers because of bugs.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.44387-680638</guid>
		<pubDate>Mon, 14 Aug 2006 13:40:05 -0800</pubDate>
		<dc:creator>AmbroseChapel</dc:creator>
	</item><item>
		<title>By: LoopyG</title>
		<link>http://ask.metafilter.com/44387/CSS-Help#680755</link>	
		<description>I tried using pigpen&apos;s method, and it worked very well. However, as AmbroseChapel said, there were bugs in IE viewing. I instead simply load a new page that has a different interface for navigating the sub-menu (only one of the main menus items had a sub-menu).</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.44387-680755</guid>
		<pubDate>Mon, 14 Aug 2006 14:42:09 -0800</pubDate>
		<dc:creator>LoopyG</dc:creator>
	</item><item>
		<title>By: jxpx777</title>
		<link>http://ask.metafilter.com/44387/CSS-Help#680957</link>	
		<description>Try it using display:none instead of visibility:invisible. And I would also suggest putting your links in a list instead of just autonomous anchor tags. Here is something that could work (untested).&lt;br&gt;
&lt;br&gt;
ul#navigation li ul {display: none;}&lt;br&gt;
ul#navigation li:hover ul, ul#navigation li.over ul{display:block; position:absolute; top:1em;}&lt;br&gt;
ul#navigation li {position:relative; display:inline;}&lt;br&gt;
&lt;br&gt;
Then you can do something like&lt;br&gt;
&lt;br&gt;
&lt; ul&gt;&lt;br&gt;
&lt; li&gt;&lt; a&gt;Nav Item&lt; /a&gt;&lt; /li&gt;&lt;br&gt;
&lt; li&gt;&lt; a&gt;Nav Item&lt; /a&gt;&lt;br&gt;
     &lt; ul&gt;&lt;br&gt;
     &lt; li&gt;&lt; a&gt;Sub Nav Item&lt; /a&gt;&lt; /li&gt;&lt;br&gt;
     &lt; li&gt;&lt; a&gt;Sub Nav Item&lt; /a&gt;&lt; /li&gt;&lt;br&gt;
     &lt;br&gt;
&lt; /li&gt;&lt;br&gt;
&lt; /ul&gt;&lt;br&gt;
&lt;br&gt;
The only problem with this is that IE doesn&apos;t respect the pseudo-class :hover on non-anchor elements, so you would need a tiny bit of Javascript to implement this for IE.&lt;br&gt;
&lt;br&gt;
window.onload = function(){&lt;br&gt;
     var theNav = document.getElementById(&apos;navigation&apos;);&lt;br&gt;
     var theList = theNav.getElementsByTagName(&apos;li&apos;);&lt;br&gt;
     for(i = 0; i &lt; thelist.length; i++){br&gt;
         theList[i].onmouseover=function(){&lt;br&gt;
              this.className += &quot; over&quot;;&lt;br&gt;
         }&lt;br&gt;
         theList[i].onmouseout = function(){&lt;br&gt;
              this.className=this.className.replace(&quot; over&quot;, &quot;&quot;);&lt;br&gt;
         }&lt;br&gt;
     }&lt;br&gt;
}&lt;br&gt;
&lt;br&gt;
You might want to use an addLoadEvent() function and put the above in an ie.js file and call it with conditional commenting so that it isn&apos;t crufting up your other code.&lt;br&gt;
&lt;br&gt;
Hope this helps.&lt;/&gt;&lt;/&gt;&lt;/&gt;&lt;/&gt;&lt;/&gt;&lt;/&gt;&lt;/&gt;&lt;/&gt;&lt;/&gt;&lt;/&gt;&lt;/&gt;&lt;/&gt;&lt;/&gt;&lt;/&gt;&lt;/&gt;&lt;/&gt;&lt;/&gt;&lt;/&gt;&lt;/&gt;&lt;/&gt;</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.44387-680957</guid>
		<pubDate>Mon, 14 Aug 2006 17:30:26 -0800</pubDate>
		<dc:creator>jxpx777</dc:creator>
	</item>
	</channel>
</rss>
