views:

62

answers:

5

Does such an add-on exist for Firefox?

alt text

+3  A: 

Firebug.

alt text

And you will have to do some simple arithmetics, if you mix borders/margins/paddings.

Xavier Ho
I think this does not exactly do what the OP wants. Padding is not equal to the distance to the parent element.
Pekka
As Pekka has said, Firebug does not have this feature.
Bytecode Ninja
Well, you're welcome to ignore my answer. But you can always measure and find out what it is with the tools available in Firebug. Nonetheless, I edited my answer to explicitly state the necessary calculation if you need to.
Xavier Ho
Well I unvoted your answer but it's just not the answer to my question. Of course I can calculate the distance myself but as I've said in the question I want a tool that displays these distances so that I don't have to calculate them myself.
Bytecode Ninja
It seems most other answers are offering the same thing. I'm curious as Pekka, too. What do you need it for?
Xavier Ho
A: 

Firebug can tell you this information: enable it, choose the HTML tab, choose the element you're interested in, then select the layout tab on the right. It shows a diagram quite similar to your artwork above :-)

psmears
Similar, yes, but not equal. As far as I can see, Firebug can't tell the distance of the right hand and bottom sides to the parent borders.
Pekka
It can't. Don't confuse padding/margin/border with the distance between an element's boundaries (e.g. its border) to the boundaries of its parent.
Bytecode Ninja
@Bytecode Ninja: in many, many cases they will be the same (or at least, this will give the information required) - think `<span>` inside `<td>` inside `<tr>` inside `<tbody>` inside `<table>`: often only one of these will have nonzero padding/margins. It wasn't clear from your question whether this would be enough or not - you might want to update your question, given the number of people who have interpreted it similarly :-) (You might also want to clarify whether you want to take into account borders, padding, margins of the inside/outside elements!)
psmears
+1  A: 

the best addon I can think of is CSSViewer, there is also firebug or web developer toolbar.

you can see more addons in this top 50 list

krike
@krike: Nice list. Thanks for sharing.
Xavier Ho
you are welcome :)
krike
Thanks for sharing the link but none of the items listed there do what I am looking for.
Bytecode Ninja
yes there is, nr 2 in that list is Firebug and that will do what you are looking for. look at the screenshot Xavier Ho made.
krike
+1 for the list!
Tom
A: 

Looks like there's not such a plugin available at the moment.

Bytecode Ninja
+1  A: 

If you can see the edges in question, there's always MeasureIt. Sometimes I find it quicker than Firebug.

Ed Daniel