| Search by tag or site | Login to my blog ? Start my own blog |
Jon Aquino's Mental GardenTechnologies 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.
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'; }
- Cool Service: Uptime Website Monitoring Service
- Svn Time-lapse View
- Royal Canadian Air Force "5bx" Daily 15-minute Exercise Program
- Simplicity And Difficulty Are Orthogonal
- October Challenge: Reading Knuth's "the Art Of Computer Programming"
- Oct 2007
- Sep 2007
- Aug 2007
- Jul 2007
- Jun 2007
- May 2007
- Apr 2007
- Mar 2007
- Feb 2007
- Jan 2007
- Dec 2006
- Nov 2006
- Oct 2006
- Sep 2006
- Aug 2006
- Jul 2006
- Jun 2006
- May 2006
- Apr 2006
![]()
Examples
Morpheus Trading - Tue Sep 02, 2008 05:21AM
NOTE: Please click on the charts below to enlarge them [read more]
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]
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]
NOTE: Please click on the charts below to enlarge them [read more]












<< My Home | TheMoneyBlogs Home