Skip to main content

How To Make A Drop Down Menu

Hello. I got a request from Tane to do this tutorial. I hope this is helpful. :)



Now before doing this, it may be best if you set up a test blog and tested this out on there so you can tweak the code to fit your needs and then when it's ready, you can put it on your main blog. But you can do whatever works for you. :)

1. Go to your blogger dashboard and select the blog you'd like to the add the drop down menu to.
2. Go to Layout >>> Add Gadget >>> HTML/Javascript and paste the following code into it.
<!-- start navmenu -->
<div id='NavMenu'>
<div id='NavMenuleft'>
<ul id='nav'>
<li><a href='LINK'>Home</a></li>
<li><a href='LINK'>CATEGORY 1</a>
<ul>
<li><a href='URL LINK TO LABEL/WEBSITE/PAGE'>SUB-CATEGORY 1A</a></li>
<li><a href='URL LINK TO LABEL/WEBSITE/PAGE'>SUB-CATEGORY 1B</a></li>
</ul>
</li>
<li><a href='LINK'>CATEGORY 2</a>
<ul>
<li><a href='URL LINK TO LABEL/WEBSITE/PAGE'>SUB-CATEGORY 2A</a></li>
<li><a href='URL LINK TO LABEL/WEBSITE/PAGE'>SUB-CATEGORY 2B</a></li>
</ul>
</li>
<!-- ADD MORE CATEGORIES HERE -->
</ul>
</div>
</div>
<!-- end navmenu -->

3. To add more categories and sub-categories, continue pasting this code:

<li><a href='LINK'>CATEGORY 3</a>
<ul>
<li><a href='URL LINK TO LABEL/WEBSITE/PAGE'>SUB-CATEGORY 3A</a></li>
<li><a href='URL LINK TO LABEL/WEBSITE/PAGE'>SUB-CATEGORY 3B</a></li>
</ul>
</li>

4. Save the gadget once you've edited to fit your needs. When you view it on your live blog, it may look a little wacky so don't panic. You just need to add some CSS to style it.
5. Go to Template >>> Customize >>> Add CSS and paste this code in the box.

/* Spacing & Border of First Link in Navigation */
.tabs-inner .section:first-child ul { margin-top: 0px; border: 0 solid #eeeeee; }
/* Background & Border of Navigation */
.tabs-inner .widget ul { background: #ffffff; border: 0px solid #eeeeee; text-align: center !important; }
/* Font, Color & Border of Links */
.tabs-inner .widget li a { font-family: new times; color: #333333; border: 0px solid #ffffff; }
/* Font & Color of Rollover Links */
.tabs-inner .widget li.selected a, .tabs-inner .widget li a:hover { color: #eeeeee; background-color: #ffffff; text-decoration: none; }
/* Center Navigation */
.tabs .widget li, .tabs .widget li{ display: inline; float: none;}
/* ----- NAVMENU Styling ----- */
#NavMenu { width: 800px; /* Change width of background */ height: 40px; /* Change height of background */position: relative;
margin: 0 auto;
padding: 0;
border: 0px solid black; /* Change Border Around Navigation */ }
#NavMenuleft { width: 800px; /* Change width of navigation */float: none;
margin: 0 auto;
padding: 0; }
#nav { margin: 0 auto; padding: 0; border: 0px solid black; }
#nav ul { float: none; list-style: none; margin: 0; padding: 0; overflow: visible; }
#nav li a, #nav li a:link, #nav li a:visited { color: #666666; /* Change color of link */display: block;
margin: 0;
padding: 10px 15px 10px; /* Change spacing */ }
#nav li a:hover, #nav li a:active { color: #0099CC; /* Change color of text on hover over */margin: 0;
padding: 10px 15px 10px; /* Change Spacing */text-decoration: none; /* Change to underlined or none for look when hovered over */ }
#nav li li a, #nav li li a:link, #nav li li a:visited { background: #ffffff; /* Change background colour of drop down text */width: 150px; color: #333; /* Change colour of text */float: none;
margin: 0;
padding: 7px 10px; /* Change Spacing */ }
#nav li li a:hover, #nav li li a:active { background: #0099CC; /* background color of drop down items on hover over */color: #eeeeee; /* text color of drop down items on hover over */padding: 7px 10px; }
#nav li { float: none;
display: inline-block;
list-style: none;
margin: 0;
padding: 0;
border: 0px solid black; }
#nav li ul { z-index: 9999;
position: absolute;
left: -999em;
height: auto;
width: 170px; margin: 0; padding: 0; }
#nav li ul a { width: 140px; }
#nav li ul ul { margin: -32px 0 0 171px; }
#nav li:hover ul ul, #nav li:hover ul ul ul, #nav li.sfhover ul ul, #nav li.sfhover ul ul ul { left: -999em; }
#nav li:hover ul, #nav li li:hover ul, #nav li li li:hover ul, #nav li.sfhover ul, #nav li li.sfhover ul, #nav li li li.sfhover ul { left: auto; }
#nav li:hover, #nav li.sfhover {position: static;}

6. You can customize the codes in red.
7. Don't forget to save and view your template.

Comment below if you have any questions. :)

xx Nicole Rose

Comments

  1. Thanks so much for this. I've been wondering about it for ages:)

    ReplyDelete
  2. Love this, thanks. Now if only I could figure out to change the color of my scroll bar...*hint, hint* ;)

    Sophia.xo

    ReplyDelete
  3. Thank you so much. You should do more tutorials like this.

    ReplyDelete

Post a Comment

All comments I receive are cherished for many hours after reading them. Thank you for taking the time to type something to me.

xx Nicole Rose

Popular posts from this blog

May I ask for your [honest] opinion?

via Alrighty. I recently just completed my one hundredth blog design order [insert celebratory balloons, glitter cannons, and thrown pies here]. ;} And I was talking to my mother about this in the car, to and from the store. Basically, what she said was; "You've been doing your designs for a long time, right? So why don't you start charging for your services?" This got me thinking, and in my eyes, I feel as though charging for my designs would probably make me feel like I'm getting cocky, and too proud of my work, yah know? But I wanted to ask you guys, my honest readers; do YOU think my services are worth spending money on? Like seriously. If you wanted a new design would you choose me, even if it cost you ten dollars? I know most of it is just a matter of opinion. Every designer has their own way of doing things. Their own unique style. It all depends on what the "order-er" wants. I'd like to know if I have the capabilities of giving s...

I have so many ideas, and so little time...

Well. I've created a writers group, so I can check that off my list of dream tasks (huzzah!) but now that I've completed one task, I've come to reveal that I have a whole other bunch of ideas to set upon making real, as well. I want to--oh so badly want to--create a writers support group, in the form of a collaboration blog. Mackenzie and I had considered doing this, but since we haven't talked much lately, I guess... Well, maybe there are some volunteers out there who would like to help me make this idea come to life? Hm? If not, it's alright, I may have to postpone this dream for a (small) while anyway because I am very busy grooming other dreams. Like... + My writers group. As mentioned previously, this group is to help me prepare my manuscript for publication, but is very much still in the "forming phase". + ( The research of) Getting my book(s) published . Gosh guys, this is going to be a lot harder than I thought (did you know an author must...

Guest Post by Bethan

Hey there! It's Bethan from Think. Read. Write. Dream. The beautiful Rose was kind enough to let me guest post on her amazing blog - which is such an honour! I'll start with a little about myself. :) I'm 14 years old, with curly brown hair, eyes that don't really have a specific colour and very pale skin. I'm also really small... I'm right-handed, a bit socially awkward, a perfectionist and a tiny bit crazy. I am a Christian that loves reading, writing, blogging and drawing. I've wanted to be a writer since I was really young and am always daydreaming. I love to play the piano, and have just passed my Grade 4 exam. If you enjoy this guest post, you can head over to my blog where I post book hauls, occasional tags and awards, quite a few of my writings and a little bit of randomness (okay.. a lot of randomness.) Here's a little taste of my writings. I hope you enjoy. :) The sky is dark with grey clouds and I hear a faint rumbling coming from abo...