Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to create a menu 'toolbar' like on the default Google homepage?
    text
    copied!<p>I am trying to create a homepage with a 'toolbar' look like the one that is used in the default google homepage.</p> <p>I have managed to put some HTML and CSS together, but I still have not been able to work out how to do the following two things:</p> <ol> <li><p>How to "gray out" the background of the menu item as the mouse hovers over it (like in the Google page)</p></li> <li><p>How to implement a nested menu. With this, I suspect that this may not be possible with CSS alone and so I may need to use javascript (in which case, I'll use jQuery)</p></li> </ol> <p>The menu structure is like this:</p> <pre><code>Menu 1 Menu 2 Menu 1 Sub Item 1 Menu 2 Sub item 1 Menu 1 Sub Item 2 Menu 2 Sub item 2 Menu 2 Sub Item 2 Sub Item 1 Menu 2 Sub Item 2 Sub Item 2 Menu 2 Sub Item 3 </code></pre> <p>Here is the (HTML and CSS) I have come up with so far:</p> <pre><code>&lt;html&gt;&lt;head&gt; &lt;style type="text/css"&gt; *{ padding:0px; margin:0px;} h2, h3{ color: #1f497d; padding: 10px 0px 10px 0px; } body{ font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #52525c; line-height: 18px; } #navigation{ background-color: #2d2d2d; color: #FFFFFF; height: 25px; list-style-type: none; font-size: 13px; } #navigation ul li { list-style-type: none; padding: 5px 20px 3px 5px; float: left; } #navigation a{ color: #CCCCCC; text-decoration: none; } #navigation a:hover, a:visited, a:active{ color: #FFFFFF; border-bottom-color: #c00000; border-bottom-width: 2px; border-bottom-style: solid; } #navigation a.current{ color:#FF0000;} .tab{ width: 10%; float: left; text-align: center; font-size: 16px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #CCCCCC; border-right-width: 1px; border-right-style: solid; border-right-color: #CCCCCC; border-left-width: 1px; border-left-style: solid; border-left-color: #CCCCCC; } .tab2{ float: right; width: 8%; text-align: center; margin: 2px; background-color: #EFEFEF; color: #336699; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div&gt; &lt;div id="navigation"&gt; &lt;ul&gt; &lt;li class="current"&gt;&lt;a href="#"&gt;Menu Item 1&lt;/a&gt;&lt;/li&gt; &lt;li&gt; &lt;a href="#"&gt;Menu Item 2&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Menu Item 3&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Menu Item 4&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Menu Item 5&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Menu Item 6&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Sign in&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt;&lt;/html&gt; </code></pre> <p>Can someone help me with how to implement 1 and 2?</p>
 

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