Quantcast CSS Tool: Convert Margins To Padding
Search by tag or site Login to my blog ? Start my own blog














TheMoneyBlogs
Home
About
Create your own blog
Contact us
Vote for this blog!

Jon Aquino's Mental Garden

Technologies that make life wonderful

CSS Tool: Convert Margins To Padding

Posted on 08/29/2006 00:00 AM | Link | Post Comment
Ever wonder what the source of those mysterious gaps on your webpage is, but Web Developer Extension won't tell you because it can only inspect padding but not margins? You click on the space, but in vain--Firebug won't tell you the source element because that gap is caused not by an element's padding but by some errant margin.

Enter "Convert Margins To Padding". Just paste this javascript snippet into the Firebug command line, and it will replace all elements' padding values with their margin values. Then you can click on the mysterious gap and discover its element.

var elements = document.getElementsByTagName('*'); for (var i = 0; i < elements.length; i++) { elements[i].style.paddingTop = document.defaultView.getComputedStyle(elements[i], ').getPropertyValue('margin-top'); elements[i].style.paddingRight = document.defaultView.getComputedStyle(elements[i], ').getPropertyValue('margin-right'); elements[i].style.paddingBottom = document.defaultView.getComputedStyle(elements[i], ').getPropertyValue('margin-bottom'); elements[i].style.paddingLeft = document.defaultView.getComputedStyle(elements[i], ').getPropertyValue('margin-left'); elements[i].style.marginTop = '0'; elements[i].style.marginRight = '0'; elements[i].style.marginBottom = '0'; elements[i].style.marginLeft = '0'; }
Stock Quote or
Examples
Morpheus Trading - Tue Sep 02, 2008 05:21AM
NOTE: Please click on the charts below to enlarge them [read more]
Morpheus Trading - Thu Sep 04, 2008 04:34AM
NOTE: Please click on the charts below to enlarge them if [read more]
Morpheus Trading - Wed Sep 03, 2008 04:35AM
NOTE: Please click on the charts below to enlarge them [read more]

PREMIER SPONSORED LINKS

Most Visited Blogs | Most Popular Blogs | Most Recent Blogs | Contact Us | Terms and conditions | Privacy Policy

The columns, articles, message board posts and any other features provided on TheMoneyBlogs.com are provided for personal finance, education and investment information and are not to be construed as investment advice. Under no circumstances does the information in this content represent a recommendation to buy, sell or hold any security. The views and opinions expressed in an article or column are the author's own and not necessarily those of TheMoneyBlogs.com and there is no implied endorsement by TheMoneyBlogs.com of any advice or trading strategy. The analysts and employees or affiliates of TheMoneyBlogs.com may hold positions in the stocks or industries discussed here. Your use of this and all information contained on TheMoneyBlogs.com is governed by the Terms and Conditions of Use. Please click the link to view those terms. Follow this link to read our Editorial Policy.

Copyright © 2008 The Connors Group, Inc.