Southern Listeners

Loading
Thanks to Greenlava for this cool gadget. Get yours here

Friday, November 12, 2010

Identify Blogger Gadget ID

Identifying Blogger's gadget (or element) ID is important when it comes to tweaking your blog. This is because most Blogger tweaks involves CSS styling (emphasize on 'most'). In order for you to style an element using CSS code, you'd have to address that element first. And it will not be possible if you do not know the element's ID or class.

Here comes another question, what is an ID and what is a Class? This question tangential to what is being discussed in this tutorial, but for the sake of simplicity, you'd only have to know that an ID is a unique identifier used to address ONE specific element in a page, whereas a class is an identifier that can be used to address few elements as whole. All 'built-in' gadgets in Blogger can be addressed using IDs. So knowing an element's ID will allow you to apply CSS styling on it. Common tweaks that are applied to these gadgets are margin-reduction, repositioning, resizing and even hiding an element completely from a given page.

In this tutorial, I will share with you two methods on how you can identify your Blogger's elements' IDs. The first one is a straight-forward method, recommended for beginners. The second method is also straight-forward, but you'd have to install an add-on for it. Opt for the second one if you're gonna be finding out your element's IDs or classes frequently.

Method 1:

To find out your gadget's ID, go to Page Elements/Layout. Click Edit on the gadget that you want to find its ID. A new window will pop-up. Click on the address bar, and navigate until the end of the line. See below for example:


In the example above, my ID is PageList1. I can address this gadget using this ID now. A quick example, say I want to adjust this gadget's width, all I have to do is go to Template Designer - Advanced - Add CSS - and address the gadget as such:
#PageList1{
width: 50%; 
}

Method 2:

Use FireBug of course!~ It's so easy to use, and it's a must have if you're a heavy blog tweaker. Get your own here. Once you've got it installed, you will see a small bug icon on the bottom right side of your browser. Click on it. Refer to the image below.


This will bring out a mini-window on your current page. At the top-left side of this window, click on the 'Inspect' button. Refer to the image below.


Being equipped with your new nerd-toy, it's just a matter of pointing and inspecting the elements. See the image below. It shows the same ID as Method 1.


The advantage of this method is that you can find an element's ID or class easily, and this element doesn't even have to be a gadget. Imagine this. You want to increase the width of your blog. Which element will you address? You can't use the first method to find an accurate solution (although it will give you the section ID).

Have fun.

17 comments:

  1. Thanks! Just what I was looking for right this moment!

    I keep having a hard time with opening and using Firebug =)

    ReplyDelete
  2. Can you add an "HR Line" this way, too?

    ReplyDelete
  3. RaindopSoup: Identifying an ID will be very useful when it comes to tweaking your blog. I'm sure it'll be very helpful.

    Glenn: HR Line is an element of HTML. We can't add HTML using CSS (the reverse is possible). CSS can only be used to style an element, not add one. However, you can add an HTML easily once you've known the place where you wanna add it. My advice: Use Firebug in your blog to see what's the ID of the element (or nearest element) where you want to add your HR Line, then go to Edit HTML - Expand Widget Templates - Find for this ID - add HR line to the HTML accordingly.

    ReplyDelete
  4. Glad you got it figured. Cheers.

    ReplyDelete
  5. Thank you for pointing out FireBug!

    ReplyDelete
    Replies
    1. Have fun with it. It's awesome and powerful.

      Delete
    2. Hi, i am from brazil, them sorry my english. help me. i'm need show 2 gadget labels, but the blog show only 1, the first. because i am using labels how menu, cus the blog no load my menu that i try load. how maker for show more that 1 labels, tks.

      Delete
    3. Hi there, this should help --> http://www.southernspeakers.net/2010/10/adding-already-added-gadget.html

      Delete
  6. hello again! I used the CSS code provided on this tutorial to edit the margins of my page list. but what is the css code to adjust the width in between my page list and blog description? Thank you so much!

    -www.youareair.blogspot.com

    ReplyDelete
    Replies
    1. Hi there, try this:

      .descriptionwrapper{
      margin-bottom: -20px !important;
      }

      Cheers.

      Delete
  7. Great site. I am using this trick in my one blog page. Thanks f sharing this great post.

    ReplyDelete
  8. Wow! Love the look of your Homepage & styling...Any chance you can do a tutorial on how to achieve a similar look?
    Theo

    ReplyDelete
    Replies
    1. Hi Theo,

      I use a typical 3-columned Minima template, and changed the colors of the borders is all.

      Cheers :)

      Delete
  9. OMG where has Firebug been all my life! Thanks for the tip. I've been using it to increase the top and bottom padding for my sidebars/gadgets. Works like a charm to id those elements.

    ReplyDelete

Please use the 'Ask a Question' page to shoot questions that are not related to the tutorial in the post above.