I work as a front-end developer and I keep getting bugs filed by a UI Designer who says that 2 of my elements are slightly misaligned and need to match the mockup more closely. I've looked at my page a million ways and I can't see how anyone could claim that these 2 boxes aren't perfectly aligned. I've looked in Inspect Element and there are perfect horizontal lines through the tops and bottoms of the boxes. I want some way of "proving" this, though. So I want something like
function( var id1, var id2 )
{
/* id1, id2: identifiers of the 2 divs */
/* .... */
}
to print something like
vertical position of top and bottom of first div: 162px, 180px
vertical position of top and bottom of second div: 162px, 180px
to the console, where the pixels are the absolute position with respect to the whole page (or the body
, I suppose). Is this possible, and if so, how do I implement it?