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

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...