Skip to main content

Tutorial: Accordion Button



Hello there. :) As requested, today I am going to help all you lovely bloggers out with making an accordion button.

An accordion button is when you have a series of titles or links and when you click one, it opens to reveal hidden content. o.o If you need a better example, just check out the bottom of my sidebar, and click on "Copyright", "Search", or "Sponsors". :)

Now to make this lovely little gadget, you'll need to:

1. Log into your blogger account.
2. Select the blog you'd like to add this button to.
3. Go to your blog's Layout, and click "Add a Gadget".
4. Select the "HTML/JavaScript" gadget, and paste the following code into it:

<center><style type="text/css">

#wrapper {
width: 250px;
margin-left: 50;
margin-right: 50;
border-top: 0;
border-bottom: 0;
padding: 5px;
background: #bbb;
}


.accordionButton {
width: 250px;
float: none;
cursor: pointer;
color: #000000;
text-align:center;
padding:0px;
margin-bottom:2px;
padding: 5px;
}
 

.accordionContent {
width: 250px;
float: none;
display: none;
background: #fff;
color: #000;
padding: 5px;
}

</style>
<!doctype html public "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"> </script>
<script type="text/javascript" src="http://hrpblogdesigns.webs.com/Accordion%20Menu/javascript.js"> </script>
<div id="wrapper">
<a href=BLOG LINK><div class="accordionButton">Home</div></a>
<div class="accordionButton">
About</div>
<div class="accordionContent"><p align="center">
Put a little bio or something here. Just tell us about yourself. Customize to your pleasure.</p></div>
<div class="accordionButton">
Contact</div>
<div class="accordionContent">
Contact information or links can go here. :)</div>
</div></!doctype></center>

5. Save and view.

Tada! :) Now if you'd like to customize it:

#wrapper - Changing the CSS in here will change the overall accordion button.

.accordionButton - Changing this CSS will customize the title as well as the outer appearances of the buttons.

.accordionContent - Changing this CSS will control how the innards of the button will look. If you want your bio and contact information to have a red background when opened, you change "#fff" to "red".

BLOG LINK - This is just a simple home link. When someone clicks this, they'll be redirected to the home of your blog.

Button Titles - The text in the light blue tint are the titles of the button. Change these to change the titles.

Content - The text in the magenta is the content of the buttons. When the title is clicked, the button will open up to reveal these words.

I hope I didn't just confuse you further. If you need help, or have any questions, just ask me down below, in the comments. :)

Have a blessed day, and thank you for reading. <3

Comments

  1. Awesome Rosie! Thanks for sharing, I've been wondering how to do this for a while. :) By the way, how did you learn HTML/CSS? I'm working on learning them (does that make sense? :) ) and was wondering if you have any advice. :)

    xx

    ReplyDelete
  2. Awesome! Thanks for doing this tutorial!- Jollygirl from http://reflectionsofajollygirl.blogspot.com/

    ReplyDelete
  3. Wow, this helps a lot! Hopefully my Web Design class will help with things like this. Also, I nominated you for the Sunshine Award - questions are on my blog: http://endlessvariations.blogspot.com/

    ReplyDelete
  4. Emily17.7.14

    Rosie I can't copy the text...

    ReplyDelete
  5. Thank you SO much for this, so helpful! xx

    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

The Best Experience in the History of Experiences

Last week, on September 13th, 2013, two amazing things happened. Niall Horan--of One Direction--turned 20! *sends glittery kisses into the wind* I didn't forget you, baby! I promise! I met up with the most amazing person that has ever come into existence . ^^^ *sniffles* Here is a photo of our good-bye hug. Kenz  added the glitter. ;) My family and I had to drive about three and half hours, to get to our meeting place--which was a beautiful Barnes and Noble full of amazingly exquisite  books [it was quite heavenly]. The whole trip there I was bubbling with excitement. Rocking in my seat, tugging at my hair, belting out the lyrics to any songs I knew when they blasted out of the speakers. I had a little brother to my left, a window to my right and a present in my lap--and a stuffed Pikachu at my feet. o.O Finally , we arrived at our destination. I cannot describe to you the feeling of walking up to that bookstore, and having a someone whom you haven't p...

silver linings

 a post inspired by this lovely photo. [ photo via pinterest ] sitting swinging singing head bowed arms hanging voice low thinking blinking shrinking gears turning eyes wide shoulders slumped where did it all go? * * * She doesn't want to look up, only for her eyes to find the dark and terrible surroundings she calls her world. She doesn't want to go back, to the dwelling where words were spoken and exchanged but never taken back. She doesn't want to sit there forever. But that seems like the best option right now. While she swings, she listens and thinks, sings and sinks, the only company she has is the rag doll under her fingertips. It looks worn--just like her. And torn--again, like her. And used--just. like. her. Yet loved--a foreign feeling that has been wasted. She lifts her head to look up at the dark sky, wishing the clouds would split apart and act merciless upon her. Instead, they seem as if to slowly zip open, lightl...

"it's complete"

[ photo via pinterest ] writing. exhaling words onto paper inhaling the smell of ink scribbling furiously shoulders tensing the pencil stops dead in its tracks words are hard writing ceases days pass by no words are exhaled no ink is inhaled the author is taking a break dreams occur inspiration is sparked writing begins again and it doesn't stop "it's complete" two words that mean so much sentences build paragraphs that build chapters that build a book that build a lesson, a story my lesson to you is || don't ever give up thanks for reading. <3 xoxo, Rose pinterest instagram bloglovin