2014년 9월 2일 화요일

Remove Space between Gadgets in Blogger Sidebar

Remove Space between Gadgets in Blogger Sidebar

Here's a popular question: "How do I remove spaces between gadgets on my sidebar?" I have seen this question being asked many times that I think a proper straight-forward tutorial is needed for this matter for future references. One might want to remove spaces between gadgets for various reasons. A common one is to use a picture gadget as a title, so the picture gadget needs to be really close with the next gadget to serve as a title. If you're interested in reducing space between your blog posts, see this tutorial instead.




Step 1:

As you might have already guessed, you have to identify your Gadget's ID. You have lots of elements in a page. CSS allows you to address a particular element or a particular group of elements via its class or ID. Please refer to this post on a brief note about IDs and Classes. Enough with the lecture, check out how you can identify your gadget's ID here. To play safe, identify both top and bottom gadgets' IDs (the space that will be removed lies between these two gadgets)

This is the ID of my gadgets (using my favorite add-on FireBug of course):



So my top gadget's ID is Label1, and my bottom gadget's ID is BlogArchive1.

Step 2:

If you're using the old Blogger interface:
 Go to Dashboard - Design - Template Designer - Advanced - Add CSS - paste the following code - Press enter after the last character of the last line } - Apply to Blog.

If you're using the new Blogger interface: Go to Dashboard ('House' symbol) - Template - Customize - Advanced - Add CSS - paste the following code - Press enter after the last character of the last line } - Apply to Blog. 
1
2
3
#Label1{
margin-bottom: -50px !important;
}

Replace 'Label1' with the ID of your top gadget. By doing this, the gap between these two gadgets will be reduced. It goes without saying that you'd have to change the value 50 accordingly. You can use the following code too:

1
2
3
#BlogArchive1{
margin-top: -50px !important;
}

Where 'BlogArchive1' is the ID of your bottom gadget. You have seen two different ways on how you can reduce the gap between your gadgets. In most cases, just use either one of these methods and it will work like a charm. In some rare cases, you might have to use both these methods combined.

Also, if you want to reduce 2 gaps between 3 gadgets, checkout the screenshot below. It speaks for itself:


Now that you've gotten the idea, it's just a matter of creativity on how you use these useful tools. And yes, you can use 'margin-right' and 'margin-left' CSS attributes as well to move your gadgets/elements horizontally. Have fun!

댓글 없음:

댓글 쓰기